Trying to play the Mosaic tutorial, I fail

144 views
Skip to first unread message

pagani laurent

unread,
Dec 14, 2013, 5:47:18 PM12/14/13
to hugin
Hello,

I am quite a beginner with Hugin. I installed the 2013 version on my Mac 10.7 (Lion) and made a couple of easy panorama pictures.
A couple of times, I took pictures by moving parallel to the subject with the idea to stitch the pictures together afterwards in a mosaic style but all my pictures get strongly curved.
First I must say I did not include enough overlap because I did not know hugin and the requirements for Mosaic. That's too bad, because I won't return to those places in the next years/
Therefore I try to "save" my pictures the best I can but everything is warped, bent, whatever…

I tried to follow this tuto :

http://hugin.sourceforge.net/tutorials/Mosaic-mode/en.shtml 

but 
1) some commands do not exist anymore as described (especially " Optimizer tab and select Positions and Translation (y,p,r,x,y,z), then select Optimize now!")  
2) I have less CPs than in the tuto (29 only)
3) the image I get is not flat at all with the rectilinear projection but strongly curved. Some other projections are doing a bit better but nothing to do with what the tuto shows.

Here's the result I get :

first - second.tif

Terry Duell

unread,
Dec 14, 2013, 6:06:23 PM12/14/13
to hugi...@googlegroups.com
Hello Laurent,
Welcome to Hugin.
I have added some comments below.

On Sun, 15 Dec 2013 09:47:18 +1100, pagani laurent
<laurent...@laposte.net> wrote:

> Hello,
>
> I am quite a beginner with Hugin. I installed the 2013 version on my Mac
> 10.7 (Lion) and made a couple of easy panorama pictures.
> A couple of times, I took pictures by moving parallel to the subject
> with the idea to stitch the pictures together afterwards in a mosaic
> style but all my pictures get strongly curved.
> First I must say I did not include enough overlap because I did not know
> hugin and the requirements for Mosaic. That's too bad, because I won't
> return to those places in the next years/
> Therefore I try to "save" my pictures the best I can but everything is
> warped, bent, whatever…
>
> I tried to follow this tuto :
>
> http://hugin.sourceforge.net/tutorials/Mosaic-mode/en.shtml
>
> but
> 1) some commands do not exist anymore as described (especially "
> Optimizer tab and select Positions and Translation (y,p,r,x,y,z), then
> select Optimize now!")

In 2013 version of hugin, go to "interface" and select "expert", then in
"photos" tab go to "Optimise" and the "Geometric" menu should now provide
the Positions and Translation (y,p,r,x,y,z) option.

> 2) I have less CPs than in the tuto (29 only)
> 3) the image I get is not flat at all with the rectilinear projection
> but strongly curved. Some other projections are doing a bit better but
> nothing to do with what the tuto shows.
>
> Here's the result I get :
> What do I do wrong ?

See if using the Positions and Translation (y,p,r,x,y,z) optimisation
makes any difference, and let's know how you get on.
If you haven't already done so, probably a good idea to have look at the
"new user interface (2103)" tutorial.

Cheers,
--
Regards,
Terry Duell

pagani laurent

unread,
Dec 14, 2013, 6:07:37 PM12/14/13
to hugin
Hi again,

Just after posting, I found the missing optimizer tab in the expert mode. So I rerun the tuto including that step but the image is still projected spherically, not flat.

Laurent Pagani

"Falling leaves are a good sign. It's when you see them jumping back onto the trees that you're in trouble" Lucy van Pelt (C. Schulz)

pagani laurent

unread,
Dec 14, 2013, 6:32:27 PM12/14/13
to hugin
Hi Terry,

Thanks for the fast reply.
Starting all over again, it was much better but I still get only 21 CP, the optimizer is not as good as on the tuto :


and the image is much better than first post but still more curved than in the tuto
Any hints ?

Thanks,
Laurent

--
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/op.w73ugx1rrs0ygh%40localhost.
For more options, visit https://groups.google.com/groups/opt_out.

Terry Duell

unread,
Dec 14, 2013, 6:36:30 PM12/14/13
to hugi...@googlegroups.com
Hello Laurent,

On Sun, 15 Dec 2013 10:07:37 +1100, pagani laurent
<laurent...@laposte.net> wrote:

> Hi again,
>
> Just after posting, I found the missing optimizer tab in the expert
> mode. So I rerun the tuto including that step but the image is still
> projected spherically, not flat.
>

I have just run through that tute again, using the images from the site
links, and see similar results.
The reason, I think, is that the example images are downsized from the
originals I used when making the tute, and that is the reason why you get
a lesser number of control points.
You can make some improvement by manually adding some more control points,
widening the area covered.
Note the coverage of the control points shown in the tute (it looks like
about 38) and try to replicate a similar coverage if you can. That should
help.
The tute will give you the basics, and you should get good results
following the process, from a set of your own images.
If you still have have this problem report back.

pagani laurent

unread,
Dec 15, 2013, 6:04:12 PM12/15/13
to hugin
Hi there,

after some errance in the Mosaic tuto and perspective tuto, I managed to put a slightly bent building right up again and then I wanted to try something more difficult : stitch a mosaic of 9 dragons, defining for each picture horizontal and vertical lines and CP between images. The overlapping is not sufficient and I was not clearly parallel to the wall enough so the picture is out of focus at some borders but I won't return to the forbidden city in Beijing before long so I try to fight here but I am not very successful.  I miss two of the dragons and the two ends are not movable in mosaic mode so if I try to shift the image it bends. And it is all "barrel-like" image per image. I don't know if I can do something better than that. I defined for each image an horizontal line for the brown tile lines, top and bottom and tried to follow the tiles vertically to define some vertical lines. I wish at least that I would get more or less rectilinear images as they are at the start (with some tilt, I know, curse me to have taken the pictures so quickly). Why do I lose 2 dragons ? I have pulled the cursors far enough, it is not them which crop the image. Any hints ? Thanks.

Laurent

Frederic Da Vitoria

unread,
Dec 15, 2013, 6:24:04 PM12/15/13
to hugin-ptx
2013/12/16 pagani laurent <laurent...@laposte.net>
Hi Laurent,

I'm not sure about the horizontal lines. I'd declare them as lines but not horizontal, I believe horizontal lines are really for the horizon.

When you follow the tuto, at what point to the images stop being straight? From my experience, you first start by finding the correction parameters for your lens, then you should get a straight image, and adding a new image should never distort it. If it does, you are probably doing something wrong, either not following the procedure properly, or adding an image with completely wrong CPs. I'd start with an image from the center of the dragons, an image which allows me to check if the corrections are correct, an image where you can check that lines are parallel. If you can't find vertical lines, it is not really important here. You can rotate the final panorama at a later stage in Hugin, or you can let Hugin generate it like it is and rotate it in another tool.

--
Frederic Da Vitoria
(davitof)

Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org
IMG_7452 - IMG_7456_V1.jpg

Lukas Jirkovsky

unread,
Dec 16, 2013, 5:58:02 AM12/16/13
to hugi...@googlegroups.com
On Mon, Dec 16, 2013 at 12:04 AM, pagani laurent
<laurent...@laposte.net> wrote:
> Any hints ? Thanks.

Hello Laurent,
there is a terrible barrel distortion on your images. The problem is
that the barrel distortion parameters are difficult to optimize in
mosaic with little overlap. For mosaics, it is better to calibrate
lens in advance (take a look eg. at this tutorial [1]) to get its a,
b, c parameters. When you do the mosaics, you just load the created
lens profile and disable optimization of a, b, c.

Lukas

[1] http://hugin.sourceforge.net/tutorials/calibration/en.shtml

pagani laurent

unread,
Dec 16, 2013, 2:08:09 PM12/16/13
to hugin
Salut Frederic,

Thanks to you and Luka for the help. I did not consider defining the lens since it is recognized in the EXIF parameters of my pictures. So I guess this is my mistake.
What I don't understand here is that though there are probably tons of lenses, the most common ones should be provided in hugin so we don't have to remeasure the same parameters over and over again.
Isn't it a depository for such things ?

Second question, my lens is a zoom. Do I need to find the correction parameters for each focal length ? This can be somewhat painful…

I will check the tuto Lukas has pointed me to. I have too many Hugin tutos to digest at once, so I overlooked that one, that's a beginner's problem!...

Ciao,
Laurent

I'm not sure about the horizontal lines. I'd declare them as lines but not horizontal, I believe horizontal lines are really for the horizon.

When you follow the tuto, at what point to the images stop being straight? From my experience, you first start by finding the correction parameters for your lens, then you should get a straight image, and adding a new image should never distort it. If it does, you are probably doing something wrong, either not following the procedure properly, or adding an image with completely wrong CPs. I'd start with an image from the center of the dragons, an image which allows me to check if the corrections are correct, an image where you can check that lines are parallel. If you can't find vertical lines, it is not really important here. You can rotate the final panorama at a later stage in Hugin, or you can let Hugin generate it like it is and rotate it in another tool.

--
Frederic Da Vitoria
(davitof)

Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org

--
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.

For more options, visit https://groups.google.com/groups/opt_out.

pagani laurent

unread,
Dec 16, 2013, 2:40:18 PM12/16/13
to hugin
Hello again,

I tried to follow the tuto on calibrating lenses but it did not work (commands are too different in hugin 2013, OK, I will go and read the 2013 tuto asap).
But I found both the answer to my previous question and the lens calibration by right clicking on the image and selecting "lensfun database"…

One step forward!

Laurent

pagani laurent

unread,
Dec 16, 2013, 4:48:31 PM12/16/13
to hugin
Hi folks,

1) I read the 2013 "new features". 
2) I keep playing and understanding slowly, very slowly…

Still fighting with my dragons ;-)

3) loading only one picture, with lens profile in rectilinear mode, the lines are parallel, no barrel distorsion
4) trying to add images to that one, hugin hangs up and eventually crashes.
5) loading the 5 images at once, the rectilinear mode gives awful results, no image left. I applied the lens to all 5 images of course
6) selecting cylindrical or equirectangular, the images all show a more or less strong barrel distorsion. Why can't we keep the images with no distorsion as when loading only one ? Like in the "layout" mode ?
7) loading the 5 images via the panorama stitcher window, they all appear on top of each other in the fast panorama preview. I have to move them by hand in the move/drag tab.
8) loading the 5 images via the fast panorama preview, they appear next to each other.

So here come the pictures in Equirectangular projection before I do anything at all except loading the lens :
It is all distorted. While in layout mode (second image), they are straight. So I am lost again… I need help! Thanks.

Laurent

Frederic Da Vitoria

unread,
Dec 16, 2013, 4:51:52 PM12/16/13
to hugin-ptx
2013/12/16 pagani laurent <laurent...@laposte.net>
Salut Frederic,

Salut :-)

 
What I don't understand here is that though there are probably tons of lenses, the most common ones should be provided in hugin so we don't have to remeasure the same parameters over and over again.
Isn't it a depository for such things ?

I think Hugin uses Lensfun, but as I use only compact cameras with zooms (see below), Lensfun is probably not much use to me currently.


Second question, my lens is a zoom. Do I need to find the correction parameters for each focal length ? This can be somewhat painful…

AFAIK yes and I don't know if Lensfun handles this.

Frederic Da Vitoria

unread,
Dec 16, 2013, 4:58:15 PM12/16/13
to hugin-ptx
2013/12/16 pagani laurent <laurent...@laposte.net>

Hi folks,

1) I read the 2013 "new features". 
2) I keep playing and understanding slowly, very slowly…

Still fighting with my dragons ;-)

3) loading only one picture, with lens profile in rectilinear mode, the lines are parallel, no barrel distorsion
4) trying to add images to that one, hugin hangs up and eventually crashes.
5) loading the 5 images at once, the rectilinear mode gives awful results, no image left. I applied the lens to all 5 images of course
6) selecting cylindrical or equirectangular, the images all show a more or less strong barrel distorsion. Why can't we keep the images with no distorsion as when loading only one ? Like in the "layout" mode ?
7) loading the 5 images via the panorama stitcher window, they all appear on top of each other in the fast panorama preview. I have to move them by hand in the move/drag tab.
8) loading the 5 images via the fast panorama preview, they appear next to each other.

So here come the pictures in Equirectangular projection before I do anything at all except loading the lens :
It is all distorted. While in layout mode (second image), they are straight. So I am lost again… I need help! Thanks.

I guess it means Lensfun isn't the solution for your zoom.
- Did you take all your pictures at the same focal length?
- By any chance, did you all take them at the shortest length your zoom can do?

If so, you task could be easy: take a picture of a proper subject at the same focal subject. Proper subject is something at about the same distance that your dragons were from you, with enough vertical and horizontal lines to work it. Add this picture to your panorama and use it to calibrate your lens. Then follow all the steps.

Alternative: could you upload somewhere a downsized version of the original pictures to let us try?

Follow up for me will be tomorrow now :-) Good night

Terry Duell

unread,
Dec 16, 2013, 5:19:24 PM12/16/13
to hugi...@googlegroups.com
Hello Laurent,

On Tue, 17 Dec 2013 08:58:15 +1100, Frederic Da Vitoria
<davi...@gmail.com> wrote:


>
> I guess it means Lensfun isn't the solution for your zoom.
> - Did you take all your pictures at the same focal length?
> - By any chance, did you all take them at the shortest length your zoom
> can do?

If your lens is a zoom and in the lensfun database it probably has
distortion parameters defined for a number of focal lengths, but maybe not.
On my Linux system, the lensfun data is in /usr/share/lensfun, where there
are a lot of xml files, each may have number of lens definitions. See if
you can find the database on your system and check the data for your lens.
If it has a good spread of focal lengths it should be OK, but if not it
may not be helping you.
The lensfun web site does describe how to build a lensfun database entry
for your lens, but it is a difficult process for a zoom

>
> Alternative: could you upload somewhere a downsized version of the
> original
> pictures to let us try?
>
> Follow up for me will be tomorrow now :-) Good night
>

It's morning here :-), so I can put some time in today to assist, if I can.
Are you able to upload the images to Dropbox and invite me to share?
Probably best to use downsized images, and 3 should be sufficient.
Not sure if downsizing keeps the exif data on camera/lens which would be
useful to have.

pagani laurent

unread,
Dec 16, 2013, 5:23:37 PM12/16/13
to hugin
I guess it means Lensfun isn't the solution for your zoom.

On individual images, it seems to correct quite nicely the images.

- Did you take all your pictures at the same focal length?

Yes. 

- By any chance, did you all take them at the shortest length your zoom can do?

Yes. 17 mm.

If so, you task could be easy: take a picture of a proper subject at the same focal subject. Proper subject is something at about the same distance that your dragons were from you, with enough vertical and horizontal lines to work it. Add this picture to your panorama and use it to calibrate your lens. Then follow all the steps.

I guess I could try this indeed.


Alternative: could you upload somewhere a downsized version of the original pictures to let us try?

Why downsized ? Yes, I can upload them. About 25 Mbytes all of them together.


Follow up for me will be tomorrow now :-) Good night

Good night
Laurent

pagani laurent

unread,
Dec 16, 2013, 6:01:41 PM12/16/13
to hugin
Hello Terry,

> If your lens is a zoom and in the lensfun database it probably has distortion parameters defined for a number of focal lengths, but maybe not.

I found my lens in lensfun (a Canon EF-S 17-55 F2.8) and it is probably common enough to have been defined for a number of focal lengths and lensfun distorsion parameter says 'yes'.

>
> It's morning here :-), so I can put some time in today to assist, if I can.
> Are you able to upload the images to Dropbox and invite me to share?
> Probably best to use downsized images, and 3 should be sufficient.
> Not sure if downsizing keeps the exif data on camera/lens which would be useful to have.

I can put them in Dropbox. I put the 5 of them, because I get very different results with 1, 3 or 5.

1, with lensfun is ok

3, if I load them via panorama stitcher, they appear on top of each other in the fast Pano preview. Asking for Projection rectilinear, I get a strange image, I click on Fit and the image returns to normal and stay straight.
Selecting Move/Drag + mosaic option, I can separate them and I get a first preview not completly stupid.

5, loading them via panorama stitcher, they pile on each other, I don't seem to be able to separate them enough. Loading them in Fast Pano Preview, they appear next to each other but asking for Projection rectilinear and trying to fit, I get something useless.

Can you make something out of that ???

Cheers,
Laurent

Frederic Da Vitoria

unread,
Dec 17, 2013, 4:05:10 AM12/17/13
to hugin-ptx
2013/12/16 pagani laurent <laurent...@laposte.net>

I guess it means Lensfun isn't the solution for your zoom.

On individual images, it seems to correct quite nicely the images.

- Did you take all your pictures at the same focal length?

Yes. 

- By any chance, did you all take them at the shortest length your zoom can do?

Yes. 17 mm.

Then I don't see why Lensfun couldn't do the trick. If your lens is in the database, it must be at least with the shortest length.


Alternative: could you upload somewhere a downsized version of the original pictures to let us try?

Why downsized ? Yes, I can upload them. About 25 Mbytes all of them together.

Because you could not have enough bandwidth to upload them full size, or you might feel uncomfortable with putting the originals online or... But of course, if it's OK with you, full size would be better.

Frederic Da Vitoria

unread,
Dec 17, 2013, 4:08:20 AM12/17/13
to hugin-ptx
2013/12/17 pagani laurent <laurent...@laposte.net>

Hello Terry,

> If your lens is a zoom and in the lensfun database it probably has distortion parameters defined for a number of focal lengths, but maybe not.

I found my lens in lensfun (a Canon EF-S 17-55 F2.8) and it is probably common enough to have been defined for a number of focal lengths and lensfun distorsion parameter says 'yes'.

>
> It's morning here :-), so I can put some time in today to assist, if I can.
> Are you able to upload the images to Dropbox and invite me to share?
> Probably best to use downsized images, and 3 should be sufficient.
> Not sure if downsizing keeps the exif data on camera/lens which would be useful to have.

I can put them in Dropbox. I put the 5 of them, because I get very different results with 1, 3 or 5.

1, with lensfun is ok

3, if I load them via panorama stitcher, they appear on top of each other in the fast Pano preview. Asking for Projection rectilinear, I get a strange image, I click on Fit and the image returns to normal and stay straight.
Selecting Move/Drag + mosaic option, I can separate them and I get a first preview not completly stupid.

5, loading them via panorama stitcher, they pile on each other, I don't seem to be able to separate them enough. Loading them in Fast Pano Preview, they appear next to each other but asking for Projection rectilinear and trying to fit, I get something useless.

Can you make something out of that ???

I guess the optimization results are completely wrong. That's the kind of behavior I get when Hugin can't reach meaningful results. As someone explained before in this list (sorry I can't remember who), Hugin only performs calculations, he is unable to see it the results make sense or not.

Carl von Einem

unread,
Dec 17, 2013, 5:09:22 AM12/17/13
to hugi...@googlegroups.com
With such optimization errors it makes sense to reset the lens
parameters (right click in the images list on the Photos tab: Reset...)
and manually optimize again being very careful with a,b,c. Start with
lensfun defaults if available and after optimizing the position
parameters y,p,r and v make two separate optimization runs with both
image center shift variables d,e (separately, did I already mention
that?), they are available in Advanced and Expert mode.

Lukas Jirkovsky schrieb am 16.12.13 11:58:

Frederic Da Vitoria

unread,
Dec 17, 2013, 5:08:16 PM12/17/13
to hugin-ptx
2013/12/17 Carl von Einem <ca...@einem.net>

Laurent, did you manage to get a correct panorama? I am not sure if you posted your photos on Dropbox and forgot to post the link or...
Reply all
Reply to author
Forward
0 new messages