Grid Stitching Senior Design Project

70 views
Skip to first unread message

Derek W

unread,
Feb 3, 2015, 5:17:17 PM2/3/15
to hugi...@googlegroups.com
Hello!

I am a senior computer engineering major working on my senior design project in image stitching. For this project I am working with stitching hundreds of rice field images with GPS metadata included. I have decided to give PanoTools a shot for stitching these images, and have made a prototype script for stitching 2 images together. Here you can see the prototype BASH script:

pto_gen -o to_stitch.pto -p 0 -f 10 $1 $2
autopano-sift-c output.pto to_stitch.pto
pto_var --opt y,p,r -o output2.pto output.pto
autooptimiser -n -o output3.pto output2.pto
autooptimiser -m -o output4.pto output3.pto
pano_modify -o output5.pto --center --straighten --canvas=AUTO --crop=AUTO output4.pto
echo "optimiser done, see optimised.pto. creating make"
pto2mk -o output.pto.mk -p output_stuff output5.pto
echo "done creating make, see final. now making."
make -f output.pto.mk

Using this script I am able to successfully stitch two rice field images left to right. The problem comes when I rotate each of them 90 degrees. It seems that autopano-sift-c can't find control points vertically. It is my understanding that SIFT algorithm alone should be able to identify control points, but I'm guessing this implementation must have been optimised for panoramas. 

So my question: Does anyone know a way to get autopano-sift-c to detect keypoints vertically? If not, is there another keypoint finder I should look into?
Also if you see anything in this script that looks dumb or unnecessary please let me know.

Thanks!

Terry Duell

unread,
Feb 3, 2015, 6:54:36 PM2/3/15
to hugi...@googlegroups.com
Hello Derek,
I haven't tried stitching combinations of portrait and landscape images
lately to recall how best to tackle this. I would try using cpfind instead
of autopano-sift-c, and maybe also use cpclean.

> Also if you see anything in this script that looks dumb or unnecessary
> please let me know.

Still thinking about that. That could depend on how the images were
produced, and whether it would be useful to also optimise other parameters.


Cheers,
--
Regards,
Terry Duell

Derek W

unread,
Feb 4, 2015, 9:31:30 AM2/4/15
to hugi...@googlegroups.com
OK, I was mistaken. autopano-sift-c works great for finding keypoints. I'm just having difficulties stitching them together.

Is there a way to see what command line calls Hugin uses when you click certain buttons? I am able to stitch them in Hugin, I just dont know how to do it using the tools. I keep receiving segmentation faults, and Hugin does a much better job than the script.

Terry Duell

unread,
Feb 4, 2015, 5:38:34 PM2/4/15
to hugi...@googlegroups.com
Hello Derek,

On Thu, 05 Feb 2015 01:31:30 +1100, Derek W <djrobo...@gmail.com> wrote:

> OK, I was mistaken. autopano-sift-c works great for finding keypoints.
> I'm just having difficulties stitching them together.
>
> Is there a way to see what command line calls Hugin uses when you click
> certain buttons?

When hugin has completed a stitch, save the .pto file and then examine
that to see what parameters were optimised.

> I am able to stitch them in Hugin, I just dont know how to do it using
> the tools. I keep receiving segmentation faults, and Hugin does a much
> better job than the script.

hugin shouldn't be segfaulting. What version of hugin, and what OS?
There may be a later version that you can use.

Carlos Eduardo G. Carvalho (Cartola)

unread,
Feb 6, 2015, 5:21:52 AM2/6/15
to hugi...@googlegroups.com
I have already found vertical CP to stitch a zenith image in a spherical panorama using cpfind in a script. I agree with Terry's suggestion to try it.

You don't need to generate so many temporary files, unless you want them for something. You can just point to the same file as input and output, like:
pto_var --opt y,p,r -o output.pto output.pto
autooptimiser -n -o output.pto output.pto

Cheers,

--
A list of frequently asked questions is available at: http://wiki.panotools.org/Hugin_FAQ
---
You received this message because you are subscribed to the Google Groups "hugin and other free panoramic software" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hugin-ptx+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hugin-ptx/e23cbeca-13f2-4d58-8418-203283039b9e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Rogier Wolff

unread,
Feb 6, 2015, 7:19:10 AM2/6/15
to hugi...@googlegroups.com
On Fri, Feb 06, 2015 at 08:21:29AM -0200, Carlos Eduardo G. Carvalho (Cartola) wrote:
> I have already found vertical CP to stitch a zenith image in a spherical
> panorama using cpfind in a script. I agree with Terry's suggestion to try
> it.
>
> You don't need to generate so many temporary files, unless you want them
> for something. You can just point to the same file as input and output,
> like:

I personally think that hugin is too liberal in throwing away temprary
files. When you're working with "easy" panoramas you click through the
assistant, and voila a wonderfully stitched panorama. But when things
get difficult, things like "finding the control points" need to be
done again and again, because the results from earlier times are not
kept.

But also, if you are incrementally adding pictures and after a certain
point decide to no longer optimize the say "background", the remapped
versions of those images are nice to keep around. (this happens if you
take say 6 shots at 18mm to make the "overview" and then zoom in to
135mm and take another 100 shots to get more details of the
interesting part. And trust me: this kind of panorama is not a "click
doit in the assitant".)

In the case at hand, if you get the dependencies right, Make is a good
tool to re-do the minimal amount of work.

For hugin in general, the problem is a bit that every remapping
depends on the PTO file. So you need to extract the remappings of each
picture, put them in a separate file, and then use a "move-if-changed"
tool to update the extracted files again.

Anyway, I'm a bit supporter of many intermediate files and not
throwing them away.

Roger.
> > <https://groups.google.com/d/msgid/hugin-ptx/e23cbeca-13f2-4d58-8418-203283039b9e%40googlegroups.com?utm_medium=email&utm_source=footer>
> > .
> > For more options, visit https://groups.google.com/d/optout.
> >
>
> --
> A list of frequently asked questions is available at: http://wiki.panotools.org/Hugin_FAQ
> ---
> You received this message because you are subscribed to the Google Groups "hugin and other free panoramic software" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to hugin-ptx+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/hugin-ptx/CALW1f7gkLDdjfjsiRe8g_C84qU1dqhF8HWbKj4WKVuqd2a4_oA%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

--
+-- Rogier Wolff -- www.harddisk-recovery.nl -- 0800 220 20 20 --
- Datarecovery Services Nederland B.V. Delft. KVK: 30160549 -
| Files foetsie, bestanden kwijt, alle data weg?!
| Blijf kalm en neem contact op met Harddisk-recovery.nl!

Terry Duell

unread,
Feb 6, 2015, 4:39:09 PM2/6/15
to hugi...@googlegroups.com
On Fri, 06 Feb 2015 21:21:29 +1100, Carlos Eduardo G. Carvalho (Cartola)
<cart...@gmail.com> wrote:

> I have already found vertical CP to stitch a zenith image in a spherical
> panorama using cpfind in a script. I agree with Terry's suggestion to try
> it.
>
> You don't need to generate so many temporary files, unless you want them
> for something. You can just point to the same file as input and output,
> like:
> pto_var --opt y,p,r -o output.pto output.pto
> autooptimiser -n -o output.pto output.pto
>

I would suggest sticking with all the intermediate/temporary files, at
least while you are coming to grips with your stitching problems. They
give you the ability to look at incremental changes and test the effect of
command line parameter changes.



--
Regards,
Terry Duell

Terry Duell

unread,
Feb 6, 2015, 6:28:59 PM2/6/15
to hugi...@googlegroups.com
Hello Derek,

On Thu, 05 Feb 2015 01:31:30 +1100, Derek W <djrobo...@gmail.com> wrote:

> OK, I was mistaken. autopano-sift-c works great for finding keypoints.
> I'm just having difficulties stitching them together.
>
> Is there a way to see what command line calls Hugin uses when you click
> certain buttons? I am able to stitch them in Hugin, I just dont know how
> to do it using the tools. I keep receiving segmentation faults, and
> Hugin does a much better job than the script.

Have you made any progress?
Can you tell us what is different about the stitch from hugin compared to
the stitch from your script?
If you are using the hugin Assistant to do the alignment and stitching, a
look at the .pto file for such a stitch will show that it optimises y,p,r,
lens parameters, exposure and vignetting.
Your script is doing all but lens and vignetting, so if your lens has a
lot of distortion you could expect hugin to get a better result than your
script.
Reply all
Reply to author
Forward
0 new messages