Can Hugin be configured to stitch together a high number of of overlapping 360x192 images?

936 views
Skip to first unread message

Christian Walde

unread,
Jan 31, 2012, 7:04:04 PM1/31/12
to hugin and other free panoramic software
I am trying to stitch together screenshots from a game to form a map.
Each image is of pretty low resolution (360x192) and they're taken in
chronological succession and would, bar a small amount of visual noise
and lightness difference, form 1:1 matches. There is a huge number of
images (400+).

An example of doing this manually in GIMP is available here:
http://dl.dropbox.com/u/10190786/map3.xcf

I'm trying to get Hugin to do this, but so far have only met limited
success. The main issues are:
- failure to actually get any sort of arrangement
- getting stuck at the cropping step (which i don't want anyhow)
- long time spent in photometric optimization

The only success i've had was with ~10 images, where the result was
farly good, with the only downside being it being downscaled to ~50%.

Are there known good settings for such a situation?

Christian Walde

unread,
Feb 1, 2012, 5:17:59 AM2/1/12
to hugin and other free panoramic software
Ok, after playing around with it for a night, i found my biggest
problem: It keeps trying to rotate the images, while they should
actually stay exactly as they are. Can i force hugin to skip the steps
that attempt rotation? Maybe by futzing with the EXIF values to give
them all the same alignment?

Carlos Eduardo G. Carvalho (Cartola)

unread,
Feb 1, 2012, 5:32:09 AM2/1/12
to hugi...@googlegroups.com
You can optimize only the things you need. You can mark only what you want in the "Optimiser" tab by selecting "the Custom parameters below" and then selecting the appropriated checkboxes below. Another thing to be done is to put a small fov in the lens parameter so that hugin doesn't try do make a spherical panorama.

Take a look at this recent topic on doing mosaics:

http://groups.google.com/group/hugin-ptx/browse_thread/thread/2cca964f5abf8f81

and also in the hugin tutorial on mending scanned images:

http://hugin.sourceforge.net/tutorials/scans/en.shtml

Cheers,

Carlos E G Carvalho (Cartola)
http://cartola.org/360



2012/2/1 Christian Walde <walde.c...@googlemail.com>

--
You received this message because you are subscribed to the Google Groups "Hugin and other free panoramic software" group.
A list of frequently asked questions is available at: http://wiki.panotools.org/Hugin_FAQ
To post to this group, send email to hugi...@googlegroups.com
To unsubscribe from this group, send email to hugin-ptx+...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/hugin-ptx

kfj

unread,
Feb 1, 2012, 6:16:12 AM2/1/12
to hugin and other free panoramic software


On 1 Feb., 01:04, Christian Walde <walde.christ...@googlemail.com>
wrote:
> I am trying to stitch together screenshots from a game to form a map.
> Each image is of pretty low resolution (360x192) and they're taken in
> chronological succession and would, bar a small amount of visual noise
> and lightness difference, form 1:1 matches. There is a huge number of
> images (400+).

If you know the position of the images, you can write a PTstitcher
script for the stitching, and stitch it with nona (hugin's replacement
for PTstitcher).

http://wiki.panotools.org/Nona
http://wiki.panotools.org/PTStitcher

I've used this technique for stitching together tiles forming a map.
This is probably easier than doing it in hugin (you'd spend a long
time putting all your 400 tiles in place)

But you may be better off with VIPS: Have a look at

http://www.vips.ecs.soton.ac.uk/index.php?title=VIPS

VIPS is like a speadsheet for images, with formulas and all, and it's
just the tool you want to automatically assemble large numbers of
tiles of something into a bigger picture. And you really don't want
any 'photo'-like stuff on your screenshots.

If you insist on doing it in hugin, do it as a mosaic and don't use
the assistant.

Kay

Christian Walde

unread,
Feb 1, 2012, 7:21:35 AM2/1/12
to hugin and other free panoramic software, kfj
On Wed, 01 Feb 2012 12:16:12 +0100, kfj <_k...@yahoo.com> wrote:

> If you know the position of the images, you can write a PTstitcher
> script for the stitching, and stitch it with nona (hugin's replacement
> for PTstitcher).

Sadly i don't know the positions. The images are gained by recording a video, walking over a map and then extracting frames from the video in regular intervals. The intervals are chosen so there is always overlap between the images and it is not feasible to capture the images in an edge to edge manner.

So the issue is that, to assemble the images, i need to do some analysis to find overlap points and from those match their positions up. VIPS can't do that, right?

--
With regards,
Christian Walde

Christian Walde

unread,
Feb 1, 2012, 8:06:55 AM2/1/12
to hugi...@googlegroups.com, Carlos Eduardo G. Carvalho (Cartola)
On Wed, 01 Feb 2012 11:32:09 +0100, Carlos Eduardo G. Carvalho (Cartola) <cart...@gmail.com> wrote:

> You can optimize only the things you need. You can mark only what you want
> in the "Optimiser" tab by selecting "the Custom parameters below" and then
> selecting the appropriated checkboxes below. Another thing to be done is to
> put a small fov in the lens parameter so that hugin doesn't try do make a
> spherical panorama.

I'm already using a small fov. The custom parameters in the optimizer are fairly confusing because they're pretty unintuitive. Optimizing the XYZ variables of the images seems to only resize them?

> Take a look at this recent topic on doing mosaics:
>
> http://groups.google.com/group/hugin-ptx/browse_thread/thread/2cca964f5abf8f81

I'll try reading through that later and see if it has any hints.

> and also in the hugin tutorial on mending scanned images:
>
> http://hugin.sourceforge.net/tutorials/scans/en.shtml

I followed the tutorial and it gives great results for two images, but for any more than that it fails to actually align the control points on top of each other. Also, creating a new lens for each image is fairly tedious.

kfj

unread,
Feb 1, 2012, 10:24:28 AM2/1/12
to hugin and other free panoramic software
On 1 Feb., 13:21, "Christian Walde" <walde.christ...@googlemail.com>
wrote:
> On Wed, 01 Feb 2012 12:16:12 +0100, kfj <_...@yahoo.com> wrote:
> > If you know the position of the images, you can write a PTstitcher
> > script for the stitching, and stitch it with nona (hugin's replacement
> > for PTstitcher).
>
> Sadly i don't know the positions. The images are gained by recording a video, walking over a map and then extracting frames from the video in regular intervals. The intervals are chosen so there is always overlap between the images and it is not feasible to capture the images in an edge to edge manner.

So when you run cpfind on the images, do you get a handful of control
points linking images which actually belong together? If so, the rest
isn't too hard in hugin if you know how to. I'll help.

> So the issue is that, to assemble the images, i need to do some analysis to find overlap points and from those match their positions up. VIPS can't do that, right?

No, VIPS doesn't do that for you. But hugin's cpfind may be able to do
it. May be, because your images are quite small, and I don't know how
much overlap you have, and how well the material is suited to actually
find features on. If cpfind finds nothing, you have to set CPs
manually, and then it doesn't matter if you do it in hugin or VIPS.
But since your images aren't photos but just flat tiles, you only need
one CP per overlapping image pair, and that's quickly done manually.
So try this:

1. throw a bunch of images into hugin. Choose 'rectlilinear'
projection and a small fov (like 1 degree, you want to get the whole
lot in after all)
2. in the images tab, run cpfind. If you get at least one CP per
overlapping image pair, go to 4)
3. if it did not find a control point for some overlapping pairs, you
have to set one manually.
4. In the stitcher tab, set rectilinear as output projection
5. now go to the optimizer tab. uncheck EVERYTHING. Then check X and y
for all but your anchor image. Optimize.
6. Now check the result in the quick preview. (It may be quite small,
so you'll have to adjust the output viewing angles with the sliders).
If all went well, you have the desired result and all you have to do
is center and crop the output, stitch and you're done.

Kay

Christian Walde

unread,
Feb 1, 2012, 11:09:19 AM2/1/12
to hugin and other free panoramic software, kfj
Those steps did it for me, with some added ones:

> 1. throw a bunch of images into hugin. Choose 'rectlilinear'
> projection and a small fov (like 1 degree, you want to get the whole
> lot in after all)

1.a) Don't go too small, or you'll have trouble actually previewing.


> 2. in the images tab, run cpfind. If you get at least one CP per
> overlapping image pair, go to 4)

2.a) Go through the control points and delete ones that are obviously
wrong.


> 3. if it did not find a control point for some overlapping pairs, you
> have to set one manually.
> 4. In the stitcher tab, set rectilinear as output projection
> 5. now go to the optimizer tab. uncheck EVERYTHING. Then check X and y
> for all but your anchor image. Optimize.
> 6. Now check the result in the quick preview. (It may be quite small,
> so you'll have to adjust the output viewing angles with the sliders).

Move the image around with the move tab and get the viewing angles as
close to the whole thing as possible.
6. a) Go back to 5 and repeat 3-4 times.
7.


> If all went well, you have the desired result and all you have to do
> is center and crop the output, stitch and you're done.

What was tripping me up:

Being a game it does reuse some tiles. There is generally *great* variety and most control points are perfect. However some are false positives. When the optimizer tries to match those up, strange things happen. I guess i can use the "show control point" option in the quick preview to suss those out a bit more easily. Would be nice if they displayed control point numbers.

Additionally: Chosing a very small fov means the optimizer starts out not making a lot of effort. Further runs after narrowing the field of view makes it become a lot more accurage.

A few questions: What does "control point distance" mean?
And: How do i get it to adapt the lightness differences between different images?

Christian Walde

unread,
Feb 1, 2012, 11:42:29 AM2/1/12
to hugin and other free panoramic software
Another question: Would it be possible to increase the comparison size
for control points to avoid matching tiles?

Christian Walde

unread,
Feb 1, 2012, 11:59:54 AM2/1/12
to hugin and other free panoramic software
On Wed, 01 Feb 2012 17:42:29 +0100, Christian Walde <walde.c...@googlemail.com> wrote:

> Another question: Would it be possible to increase the comparison size
> for control points to avoid matching tiles?

Answered myself here: Stop using --fullscale

I had way too many control points, so I changed the cpfind parameters to this:

"c:\Program Files (x86)\Hugin\bin\cpfind" -o marp.pto 0003-0148.pto --linearmatch --linearmatchlen 2 --sieve2width 2 --sieve2height 2

The result, with a minimum of control point correction, is this: http://dl.dropbox.com/u/10190786/map.png

Exactly what i wanted. So, especially thanks to kfj! :)

kfj

unread,
Feb 1, 2012, 1:30:56 PM2/1/12
to hugin and other free panoramic software
On 1 Feb., 17:59, "Christian Walde" <walde.christ...@googlemail.com>
wrote:

A few questions: What does "control point distance" mean?

roughly this: If you take the current image positions the optimizer
has determined and look up where the 'left leg' of the control point
would show up in the result, and compare that to where the 'right leg'
of the result shows up, ideally this would be the same spot -
difference 0. But reality isn't always that kind... and if the CP is
plain wrong, it's quite likely the distance is large. You can use the
distance to weed out bad CPs: go to the 'show CPs' symbol (second last
in the tool icon row) and choose select by distance to remove all CPs
above a vertain threshold.

And: How do i get it to adapt the lightness differences between
different images?

use the photometric optimizer, it's under the 'exposure' tab.

> The result, with a minimum of control point correction, is this:http://dl.dropbox.com/u/10190786/map.png

well, that looks pretty good! congrats.

> Exactly what i wanted. So, especially thanks to kfj! :)

:) back

Kay

Gnome Nomad

unread,
Feb 2, 2012, 1:29:42 AM2/2/12
to hugi...@googlegroups.com

This sounds like solutions mentioned on the thread about stitching
mosaics would be what you want.

--
Gnome Nomad
gnome...@gmail.com
wandering the landscape of god
http://www.cafepress.com/otherend/

Reply all
Reply to author
Forward
0 new messages