Re: [hugin-ptx] Hugin - Microscope images showing strong parallax when stitched

632 views
Skip to first unread message

Carlos Eduardo G. Carvalho (Cartola)

unread,
Jul 24, 2012, 9:53:46 AM7/24/12
to hugi...@googlegroups.com
I don't know if it is correct, but I would suggest that you try to calibrate your lens first. In this tutorial there is a way to do this with an only image that has straight lines. Can you make an image with straight lines on the microscope? I suggest that cause I imagine that the microscope lens can have a big distortion. If it works than you can use this lens file as the lens set for all images and make a common mosaic stitch as shown in other tutorials at the hugin site, like this for scanned images or this mosaic.

Cheers,

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



2012/7/24 hercat <grandr...@gmail.com>

Hello, I am a new user using version 2011.4.0

I have 12 images taken with a microscope, all overlapping with the same magnification. As the sample is on a mechanical stage, Yaw, pitch and Z (focal length of the microscope) should all be constant. In the optimizer tab, I select custom parameters and set Yaw, Pitch, and Z to be unchecked. I also uncheck the image that will be in the center of the panorama so that the software will use it as the starting image. I have all images listed as separate lenses. I run the optimizer and save the settings.

The program automatically generates suitable control points when I tell it to align. However, when I reach the fast panorama preview, the resulting image shows strong parallax, and is much narrower on the right side, even when I select Mosaic and Cylindrical projection.

If I go back to the otimizer tab, all the settings have changed, and there are now checks in the yaw and pitch columns, and none in the X Y and Z columns.

What I want to get is a roughly rectangular stitched image; each image should still be square to the observer. How do I ensure this happens?

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

Dane

unread,
Jul 24, 2012, 7:02:45 PM7/24/12
to hugin and other free panoramic software
Try not using mosaic mode. Set the field of view to something small,
and optimize for Yaw, Roll, and barrel distortion.

JohnPW

unread,
Jul 25, 2012, 12:08:11 AM7/25/12
to hugi...@googlegroups.com
I think you will want to use a rectilinear projection. You are making a "linear panorama" which is really more like a scan than a mosaic.  
This tutorial may be helpful as it is most like what you are trying to do and it extends on the scanned images tutorial Carlos suggested:
It uses an earlier version of Hugin (I think) but it should be helpful.
I'm sure a microscopic lens is quite different from typical camera lenses, but I agree with Carlos that it would be best to calibrate for it first.

David Haberthür

unread,
Jul 25, 2012, 4:00:13 AM7/25/12
to hugi...@googlegroups.com
On Tue, Jul 24, 2012 at 3:31 PM, hercat <grandr...@gmail.com> wrote:
> Hello, I am a new user using version 2011.4.0
>
> I have 12 images taken with a microscope, all overlapping with the same
> magnification. As the sample is on a mechanical stage, Yaw, pitch and Z
> (focal length of the microscope) should all be constant. In the optimizer
> tab, I select custom parameters and set Yaw, Pitch, and Z to be unchecked. I
> also uncheck the image that will be in the center of the panorama so that
> the software will use it as the starting image. I have all images listed as
> separate lenses. I run the optimizer and save the settings.
>
[snip]

A bit offtopic, but if you're stitching microscopic images, you might
be better off/faster if you use http://www.xuvtools.org/, as it's
highly optimized for this task, while hugin is highly optimized for
panoramic stitching...

David

Marius Loots

unread,
Jul 25, 2012, 5:12:29 AM7/25/12
to hugi...@googlegroups.com
hercat> The program automatically generates suitable control points when I tell it
hercat> to align. However, when I reach the fast panorama preview, the resulting
hercat> image shows strong parallax, and is much narrower on the right side, even
hercat> when I select Mosaic and Cylindrical projection.

You have to use rectilinear projection. Don't ask me why or how, below
is how I do this.

Hugin works very well for stitching microscope images. No need for
lens calibration in my experience. I follow the procedure for
stitching flat scanned images at:
http://hugin.sourceforge.net/tutorials/scans/en.shtml

For examples, look at http://histoweb.co.za/
and
http://gallery.chaos.co.za/index.php?/category/8

From my experiences, some notes:
1. The align function of the Assistant Tab sometimes work, sometimes
not, so I do it by hand as explained in the tutorial.

2. It is not always necessary to do the New Lens step. Depending on
your microscope and camera setup, this has already been set to
different lenses or, does not make any difference.

3. On the Images tab, you can use the Create control points button.
With multi-row captures, this is not always work 100%, but take
care of most of it.
4. On the panorama preview screen, NEVER touch the Center button.
5. On the fast preview screen, stay away from the Move and Drag Tab.
It is extremely easy to mess things up here.
6. One mayor hassle, and I should take invest some time and figure
what I am doing wrong:
On the Stitcher Tab, you have to click the Calculate field of view and
Calculate optimal size button, and adjust Crop in the fast preview
screen several times before it will give you the correct sized 1:1
output.
7. For large multi-row stitches,
(for example http://histoweb.co.za/012/012img001.html)
I find it useful to use the following steps:

a. Load images and set HFOV(v) = 10
b. Stitcher tab select Projection = Rectilinear.
c. Stitcher tab
Field of view: Horisontal = 50 and Vertical = 50
d. Create control points.
e. Do not do any alignment yet.
f. Open the Preview Panorama window.
g. Click None (Show none of the images).
h. On the displayed images buttons, select the first two
overlapping images.
i. Go to the optimizer tab, and do custom optimize and described in
the tutorial (Custom - r, v, d and e or Custom - r,X,Y,Z
excluding anchor). Usually rvde works best.
j. Accept results if low enough.
k. Open the Preview Panorama window.
l. Adjust the viewport.
m. Add an additional image overlapping with the previous two
images.
n. Align again.

Sometimes it is possible to add more than one image to the existing
aligned set. Problems are usually encountered when you reach the
end of the slide and go to the next row.

Hope this help, and feel free to ask if you need more info.

Groetnis
Marius
mailto:mlo...@medic.up.ac.za
--
add some chaos to your life and put the world in order
http://www.mapungubwe.co.za/
http://www.chaos.co.za/
skype: marius_loots

Hierdie boodskap en aanhangsels is aan 'n vrywaringsklousule
onderhewig. Volledige besonderhede is by
www.it.up.ac.za/documentation/governance/disclaimer/
beskikbaar.

Tom Sharpless

unread,
Aug 2, 2012, 12:38:18 AM8/2/12
to hugi...@googlegroups.com
I agree about the necessity of rectilinear projection for good mosaic results.  I would add that it can be very helpful, in case there are long straight lines that cross many images, to set 'straight line' control points along them (I do this on the frames of artwork). This kind of CP only works with rectilinear output.


On Tuesday, July 24, 2012 9:31:22 AM UTC-4, hercat wrote:

Hello, I am a new user using version 2011.4.0

I have 12 images taken with a microscope, all overlapping with the same magnification. As the sample is on a mechanical stage, Yaw, pitch and Z (focal length of the microscope) should all be constant. In the optimizer tab, I select custom parameters and set Yaw, Pitch, and Z to be unchecked. I also uncheck the image that will be in the center of the panorama so that the software will use it as the starting image. I have all images listed as separate lenses. I run the optimizer and save the settings.

The program automatically generates suitable control points when I tell it to align. However, when I reach the fast panorama preview, the resulting image shows strong parallax, and is much narrower on the right side, even when I select Mosaic and Cylindrical projection.

Marius Loots

unread,
Aug 2, 2012, 1:54:05 AM8/2/12
to hugi...@googlegroups.com
Thursday, August 2, 2012, 6:38:18 AM, you wrote:
Tom> I agree about the necessity of rectilinear projection for good mosaic
Tom> results. I would add that it can be very helpful, in case there are long
Tom> straight lines that cross many images, to set 'straight line' control
Tom> points along them (I do this on the frames of artwork). This kind of CP
Tom> only works with rectilinear output.

I have never had to use straight lines. But my slides are biological,
and most lines are curved.
Reply all
Reply to author
Forward
0 new messages