Planar camera motion stitching

92 views
Skip to first unread message

Slastunov Dmitry

unread,
Dec 23, 2019, 6:37:05 PM12/23/19
to hugin and other free panoramic software
Hello!

I need to make hi-MP scans of flat herbarium sheets (~ A3 size) without touching them, and i've made a rig with a still camera with 50 mm zeiss lens and rails with a platform under it for this purpose. So herbaium sheet can move across it and i make 3 shots of it and then stitch them. Non-linearity of movement is less than 1 mm. In my case i can't bye a 35000$ scanner for one-shot scanning.

I tried to use Kolor Autopano, Hugin and Image Composite Editor (ICE) and a got good results only in ICE, but sometimes (1-2% of scans) it can make a 0.2-0.5 mm "step" in several places in resulting image. Usually it makes steps in long lone stalks.

I'm wondering - a hugin is so complex and tunable software, but why i couldn't get any good results from it. Of course i need fully automated batch processing. Is it possible and if it is what settings i should check? I made more then 10000 stitches in ICE and almost everytime the quality was good, but i want to increase it if it's possible.

Here is a example of 3 images made on old rails with not so good linearity of movement, but it's below 2mm i think: : https://dropmefiles.com/WSD5t

Thanks in advance for your reply.


Sean Greenslade

unread,
Dec 24, 2019, 1:07:29 PM12/24/19
to hugi...@googlegroups.com
Hello. I recently used Hugin for a similar project, so here's some
notes and thoughts.

Here's an example of one of my scans: https://dumbpic.link/manu/idp/020.png

That scan contained three source photos. I used a setup with a tripod on
a table looking down and a sheet of glass holding one section of the
sheet flat. If your documents are already flat, you may not need the
glass. I had a couple of softbox lights arranged carefully to prevent
glare on the glass.

I shot in raw and processed one shot manually in ufraw, then used that
as a template to batch process the rest of the raws with the same
settings. I went with 8-bit output since HDR was not necessary for these
documents.

Because each photoset was positioned differently, I had to do some
amount of manual processing for each document. If your rig is extremely
repeatable, you might be able to make a good starting template, but I
usually find that some level of manual correction is almost always
required.

On each image set, I place a couple of horizontal and vertical control
lines on the paper edges on two end images. These help Hugin find the
right perspective correction. I then manually placed ~10 control points
on each seam. I did this manually becuase the auto control point
generator didn't work well on these documents. You can try your luck
with the auto control points, maybe it will work better for you. You may
have to remove control points that land outside of the document.

For optimization, I used the custom parameters mode. For image 0,
optimize y, p, and r only. For the rest of the images, optimize
y, p, r, TrX, TrY, and TrZ. For the lens, I optimized v, a, b, c, d, and
e. If you have a lens model that you know is good, you can just use that
and not optimize the lens.

Because my images were shot at an angle, I ended up exclude masking the
far edges of the two end images to make sure Hugin used the
higher-resolution middle image for that section of the stitch. That may
not have been necessary, but if you're getting artifacts in the stitch
it can help.

Once the optimize came out well, I set the projection to rectilinear,
tweaked the FOV and crop of the output, and rendered the final stitch.

Hopefully this gives you some ideas to start with. Feel free to share a
.pto if you're having trouble getting a stitch to come out cleanly.

--Sean

T. Modes

unread,
Dec 25, 2019, 5:20:59 AM12/25/19
to hugin and other free panoramic software
Hi,


Am Dienstag, 24. Dezember 2019 00:37:05 UTC+1 schrieb Slastunov Dmitry:
Here is a example of 3 images made on old rails with not so good linearity of movement, but it's below 2mm i think:

this example works fine also with an user defined assistant:
1.) Load images, set focal length to 50 mm
2.) Run user defined assistant: in panorama editor, select from menu Edit>User defined assistant..>Scanned images (TrXYZ)
3.) Stitch

This is also scriptable:
pto_gen --output=project.pto --fov=40 image1.jpg image2.jpg ...
hugin_executor --assistant --user-defined-assistant=scanned2.assistant project.pto
hugin_executor --stitching project.pto

alternatively you can also use ptbatchergui for the last step
ptbatchergui --batch project.pto


Slastunov Dmitry

unread,
Dec 25, 2019, 5:59:25 AM12/25/19
to hugin and other free panoramic software
Thank you all for your replies!

So as now i know that Hugin is capable for this work, I'll try to tune settings for my job and use it in mass processing in january - it's very interesting if i should get results better then from ICE. I'll reply here when i complete the comparison.

I can say that in ICE presence of artifacts is unpredictable - you can get 50 perfect images with thin long lines and 51 will have an artifact - i can't understand why it's happening. 

Now i also use special table with lined surface to help the program to stitch better, but i want to tune all such a way that lined background won't be neccecary. Im my case overlap is ~30%, image quality is good and i suppose than there are a lot of information to produce prefect stitch.

Photoscanning is a good method - even expensive scanners often have CCD sensor and it has problems with black color and contrast is decreased. Modern good CMOS sensors from Sony produce very good image quality - my stitched images are often a way better then images from usually used CCD scanners.

Here are my usual results (they are 20 Mp on preview and ~70 Mp when downloading): http://en.herbariumle.ru/?t=occ&s=%22PhotoScan%20D1%22%20%222019-11%22&f=recordCreateInfo 

Ahron

unread,
Mar 13, 2020, 2:13:30 AM3/13/20
to hugin and other free panoramic software

Ahron

unread,
Mar 13, 2020, 2:13:30 AM3/13/20
to hugin and other free panoramic software
did you complete the comparison? 
Reply all
Reply to author
Forward
0 new messages