Using PTGUI to stitch photos of 2D art.

415 views
Skip to first unread message

Bellevue Fine Art Repro

unread,
Jan 24, 2024, 3:21:42 AM1/24/24
to PTGui Support
Hi, 
I know that PTGUI is largely for making panoramic images, but I've been trying to use it with 2D images. I specialize in fine art scanning, and I've been using a Fuji GFX100 medium format camera, and photographing artwork in sections and stitching them. 

Often PTGUI gets it right, but often it gets it wrong. When it does get it wrong, I can drag one of the shots into the right location and it will snap into place. But what is intriguing me is that so often PTGUI will miss the lower left hand corner. It's very consistent in getting it wrong, and it looks like this: 

I'm trying to post the image but groups.io won't let me: 

PTGui Support

unread,
Jan 24, 2024, 3:26:35 AM1/24/24
to pt...@googlegroups.com
Hi,

So image 13 is somewhere outside the canvas? Does it have control
points? If so, I'd assume it would snap into place when running the
optimizer.

Could you post the project file? You should be able to attach it to a post.

Kind regards,

Joost Nieuwenhuijse
www.ptgui.com
> --
> You received this message because you are subscribed to the Google
> Groups "PTGui Support" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to ptgui+un...@googlegroups.com
> <mailto:ptgui+un...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ptgui/8d3d2efd-dfa6-4b5d-8ad0-78a600141eean%40googlegroups.com <https://groups.google.com/d/msgid/ptgui/8d3d2efd-dfa6-4b5d-8ad0-78a600141eean%40googlegroups.com?utm_medium=email&utm_source=footer>.

ozbigben

unread,
Jan 24, 2024, 6:45:29 PM1/24/24
to PTGui Support
Hi

Are you automatically generating control points?  If so, have you checked that there are adequate control points between all the images to perform an alignment?

We use 2 stitching methods for high resolution artworks.  2D stitching (also with PTGui) and 3D photogrammetry (particularly for foldouts from books).  The latter requires more images but is still susceptible to similar issues around the edges. I'd suggest 2 things.

1. Put something like newspaper around the art work, leaving a small gap to crop away the newspaper from the final image.  Extend the area of images you are capturing so that you have 1/2 - 2/3 of an image frame around your artwork.  Providing an area of high density detail around the artwork greatly improves alignment accuracy around the edges.

2. Optional... create a second set of images specifically for the alignment process with a greatly increased microcontrast/microdetail. Capture One or DXO PhotoLab are good for this. This will improve control point detection in areas of lower contrast. After alignment, switch the images to your calibrated images for output.  This can be particularly useful for prints with large areas of blank space if you are resolving the paper texture.


Cheers

Ben

Bellevue Fine Art Repro

unread,
Jan 24, 2024, 7:37:28 PM1/24/24
to PTGui Support
Thanks for your suggestions. It sounds like I'll need to become an expert in PTGUI, and I'm certainly trying. 

I  didn't save project files, so I remade them to share. But in doing so I'm not getting the lower left hand corner to fail in the same way, but what is happening consistently is that sometimes it works, and sometimes it doesn't. I can't tell why. But when it fails, more often than not it's apparent that the images are being warped, as if PTGUI is looking for curvature in the images but it isn't there. The images are flat, and parallel to the camera (laser aligned even). 

Sometimes it seems that when I add control points it just makes it worse. It's like, when it works it works and when it doesn't, it doesn't. When it doesn't work, looked at the numbered images and dragging them into place has been more effective than adding control points. 

I will try the suggestion ozbigben gave of adding high detailed newsprint around the images. One thing we tried that hasn't worked is to put colored dots on the painting so there is something for PTGUI to find. That has worked in the past with Photoshop, but isn't working with PTGUI. 

We have another round of paintings for this project so I've got lots of material to work with. 

I've uploaded some files and project files, both working and not working. 


Thanks much for your help. It is much appreciated. It sounds from what Ben is saying that he is also using this for 2D art so others are using PTGUI this way. 

thanks

Scott

ozbigben

unread,
Jan 25, 2024, 1:13:32 AM1/25/24
to PTGui Support
I'm only on v9 at work but luckily they're text files so I can at least see some of the settings.  It looks like your using the "1000mm focal length hack". We use this as well but we're using scanned images rather than camera images. Using the EXIF settings or faking a long focal length didn't seem to make much difference to the result.

1. Do not crop the source images.  You want the fov to be fixed for all images. Use masks in PTGui to crop out unwanted bits of the image. Variable image size = variable fov which will hurt you.

2. You want the "Advanced" interface.  Load your images.  Lens settings: Leave the fov as default. Use individual parameters for "Shift" for all lenses (double click on the column heading to toggle all of the settings)

3. Image parameters... get the number of the image that is near the centre.  Doesn't have to be exact, this is just to choose an anchor image.  For "Bad 2" I'll go with #4

4. Generate all control points. If it fails and you try to manually position the images roughly before trying again, reset the image parameters for Yaw, Pitch, Roll back to 0 after getting the CPs.  Your other "bad" example didn't generate CPs automatically for me but the subject isn't helpful for this process.

5. Optimizer Tab
This is where most of your pain originates.  Hit the Advanced button.
Optimize globally:  uncheck everything.  
Optimize per image: HShift and VShift should be checked for all images due to step 2. Uncheck these for your anchor image.  You may want to manually set these in the Image Parameters tab to re-centre the stitched result. (don't drag in the editor... you'll find out when you do ;-) )
Uncheck Yaw and Pitch for all images.
Check Roll for image 0 and uncheck Roll for your chosen anchor image.

Run Optimiser.

Load the Panorama Editor and Detail Viewer and check the alignment, especially the edges.  Review the CP distances if necessary.  You may find some image pairs have high errors at the top or bottom is CPs aren't spread across overlap.  Add extra CPs manually to fill in gaps, re-running the optimiser.

I've switched to using photogrammetry for this as it is less susceptible to parallax issues.  It's more resource intensive (2-3X the number of source images, additional processing etc...) but it's geometrically more accurate (when done properly).  It depends on what your criteria are.

Cheers

Ben

pano academy

unread,
Jan 25, 2024, 6:17:31 AM1/25/24
to PTGui Support
i downloaded the bad 2 set and tried it with v12.24.
the main problem is the different crops on each image.
this is interpreted as a different set of focal lengths.

after 1st aligning, i got some orphaned image groups that need to be manually connected (not much work, 2 or 3 connections missing, 3 CPs  pairs at each connection are enough to fix this).

after this, i got a roughly aligned stitch. now you need to tick all images for individual focal length in the lens settings tab (in the table select the lens column and hit space).
then redo the optimization. in this case, it's a huge improvement.

an additional viewpoint correction for all images irons out any imperfections in alignment (don't know anything about your rig / panohead) for a final result of 1.03px average and 4.07px max outliers.
i'd call it perfect.
important note on VP correction here:
before activating the viewpoint correction go to the render tab and check the calculated 100% result size. it's about 35k x 23k here.
after the VP correction was done the calculated 100% result is significantly smaller (13k x 9k).
you can safely crank this up to the size calculated before the VP correction.

feel free to inspect the final pts here: https://data.pblog.at/index.php/s/R9FsS8nbLSYZeAk

recommendations:
• do not crop the images to present a consistent focal length to ptgui. use the ptgui mask function as mentioned above.
• use the align to grid function to avoid missing CP generation in featureless areas.
• build a fixed workspace with repeatable image overlap
• as you've "flattened" the images in pre-production (parameters a, b and c = 0) you can use the 1000mm hack mentioned above. same here: don't crop!

hth
cheers
thomas

Bellevue Fine Art

unread,
Jan 25, 2024, 12:00:04 PM1/25/24
to pt...@googlegroups.com
Thank you both so much for the detailed answers. That’s a lot of homework, so I’ll go and review all this carefully. 

Note we didn’t use a focal length hack. I don’t know what that is.

Our setup is a fuji gfx100 with 80mm prime, on a tripod, fixed, laser aligned to a wall. The painting gets moved. Camera is stationary and painting is always parallel to the lens. 

Again much thanks. Any specific YouTube tutorials also appreciated. I need to get this right and integrate it into my workflow.

Thanks

Sent from my iThingy


--
You received this message because you are subscribed to the Google Groups "PTGui Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ptgui+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ptgui/92d2048f-9d38-4746-bf29-594713609ccfn%40googlegroups.com.

Colin Williams Photography

unread,
Jan 25, 2024, 12:32:45 PM1/25/24
to PTGui Support
Guys,
I hope you don't mind me jumping onboard this thread. My project is a little larger ie a warehouse floor. One section of the floor has 460 images taken with the Canon R5 & 24mm T&S lens. The camera is about 6ft off the ground pointing vertically down. The stitch is around 30%. There are 20 rows with each row having 23 photos. You'll see in another thread I have tried to get assistance but unfortunately PTGui has gone quiet on me. PTGui will not generate any control points at all and to do this manually is just impossible.
Can anyone advise on how we stitch 460 images in child speak please. I will try anything to make this happen.

Erik Krause

unread,
Jan 25, 2024, 1:17:46 PM1/25/24
to pt...@googlegroups.com
Am 25.01.2024 um 18:32 schrieb Colin Williams Photography:
> You'll see in another thread I have
> tried to get assistance but unfortunately PTGui has gone quiet on me.

Which thread do you refer to? I found 3 postings from this year, and all
of them were answered.

> Can anyone advise on how we stitch 460 images in child speak please. I will
> try anything to make this happen.

If it's the Aircraft Hangar one, see
https://groups.google.com/g/ptgui/c/Klf1qbCAbNc/m/R8xkuj1EAQAJ

--
Erik Krause
http://www.erik-krause.de

Colin Williams Photography

unread,
Jan 25, 2024, 1:25:40 PM1/25/24
to PTGui Support
Hi Erik, I had written to Joost directly by email after this. What he outlined above didn't work for me at all and had asked if he could rewrite the method. Now with 460 images to stitch Im certainly in need of help. Those images represent about 10% of the total needed. Its a huge project.

Erik Krause

unread,
Jan 25, 2024, 2:31:09 PM1/25/24
to pt...@googlegroups.com
Am 25.01.2024 um 19:25 schrieb Colin Williams Photography:
> I had written to Joost directly by email after this. What he
> outlined above didn't work for me at all and had asked if he could rewrite
> the method. Now with 460 images to stitch Im certainly in need of help.
> Those images represent about 10% of the total needed. Its a huge project.

Please make part of the images publicly available. Use Wetransfer,
dropbox or similar and post the link here, best in the Aircraft Hangar
thread. Downsized jpegs would be fine. It's impossible to give any
advice without the images.

Colin Williams Photography

unread,
Jan 25, 2024, 2:46:54 PM1/25/24
to PTGui Support
Hi Erik, I have uploaded the first three rows from a new bay. They are A4 jpegs. We shoot left to right for all rows - 1 to 23 then back across the room and start again if you understand what I mean.

Good luck and if it works please outline the method stage by stage. Thank you Colin

Erik Krause

unread,
Jan 25, 2024, 5:02:21 PM1/25/24
to pt...@googlegroups.com
Am 25.01.2024 um 20:46 schrieb Colin Williams Photography:

> Hi Erik, I have uploaded the first three rows from a new bay. They are A4
> jpegs. We shoot left to right for all rows - 1 to 23 then back across the
> room and start again if you understand what I mean.
> The dropbox link
> is https://www.dropbox.com/scl/fo/c6jx4pskmfwncgw2cs4xy/h?rlkey=vmrnl1zaffp10l71rzemn0b05&dl=0

Hello Colin,

I gave your images a try. First I wanted to use the native focal length
(24mm) with "Align to grid" for a first alignment, but this didn't work
out since it would have resulted in a panorama wider than 360°, which
PTGui refuses to stitch.

I choose the middle image as anchor, disabling it from all optimizations
on Optimizer tab. I've set the maximum control point numbers to pretty
high values on Tools -> Options -> Control Point Generator. Next I set
the focal length to 100000mm and asked PTGui to generate control points.
This worked out almost ok, only the rightmost column was a bit lopsided.

A few additional control points between images 22 and 23 solved that,
images 46 and 69, which didn't have control points with their left
neighbors also dropped in place. For safety I generated some between
those images using the "Generate Control Points Here" feature. After
re-optimizing (F5), I ran "Delete worst control points" from Control
Points menu. You can see the rest of the settings in the attached
project file.

A few observations:
You used manual exposure mode, which is perfect, but you also used
automatic white balance, which gives the control point generator
additional problems. Exposure time changed from 0.5s to 0.6s between
images 48 and 49, which is also less than optimal.
7zE0943316C.pts

PTGui Support

unread,
Jan 26, 2024, 5:28:23 AM1/26/24
to pt...@googlegroups.com
Colin, sorry for not replying, this must have slipped my mind. Support
questions should be posted here in the forum though.

I've posted a workflow in my reply to your previous post. This should work:

https://groups.google.com/d/msgid/ptgui/3af9362e-15b9-48ff-9e4e-a7daea8776b0%40ptgui.com

I've tried again and it works fine (although I cheated a bit and re-used
Erik's control points). Project file attached.

If the camera is perfectly perpendicular, Erik's method also works and
gives slightly better results. If it's not perpendicular, use viewpoint
correction as in my workflow above.

You said you were unable to reproduce my results. I suggest you start
from scratch, save a project file after each step and post those project
files here. We should be able to see where things go wrong.

Kind regards,

Joost Nieuwenhuijse
www.ptgui.com

vp.pts

Colin Williams Photography

unread,
Jan 27, 2024, 10:40:03 AM1/27/24
to PTGui Support
Hi Guys,
Thank you for your help so far. Success at last. The only setting I altered was the lens by replacing 24mm with 100000mm. Then I hit align images. It did take some time but in the end I have a fabulous stitch of all 460 images. The system did throw out three images but once I found them and dragged to the approximate area the result has been fantastic. So thank you so much I really appreciate the help on this one.

ozbigben

unread,
Jan 28, 2024, 6:26:28 PM1/28/24
to PTGui Support

> Note we didn’t use a focal length hack. I don’t know what that is.

Then it's most likely due to the optimisation of the FoV.  At very long focal lengths small variations in yaw/pitch/roll are visually very similar to shifting the image hoizontally/vertically.  If you try and stitch a lot of images the combined FoV can be so high that you start getting wide angle distortion or you or it may even exceed the practical limitations of the rectilinear projection.  To avoid that occuring you can fake the FoV by setting the lens to a long focal length.  For really big stuff, or very precise geometry 2D stitching is something of a hack (albeit a pretty effective one). 

You have to remember that the optimisation process uses only a small sample of control points and whilst the seams may look good the images may still be distorted if the distortion parameters are optimised.  To confirm this either way, produce a multi-layered PSB output and then set the blending mode for ALL layers to difference.  Overlapping areas between 2 images should be black.  We switched to 3D photogrammetry for this because a) we were scanning things that weren't flat and b) found the geometry to be much more accurate for the 2D output.  To give you an idea, each pixel in this image (3m long, 600dpi) is averaged from at least 9 different camera positions.

Cheers

Ben

Velson Horie

unread,
Feb 2, 2024, 2:20:51 AM2/2/24
to PTGui Support
Ben
Thank you for your contributions.
I am scanning at ca 2400 dpi on an Epson 10000XL then stitching C19th prints. Typically there are 4-8 overlapping tiles of 3.4 GB each.
PTGui does a good job, but it has taken a lot of tweaking to get secure alignment of the tiles then no distortion.
You mentioned that photogrammetry can do a better job.

What phototgrametry program did you find worked?

ozbigben

unread,
Feb 4, 2024, 7:40:56 PM2/4/24
to PTGui Support
Hi Velson

Probably best to take this offline.  Drop me an email via https://library.unimelb.edu.au/digitisation#contact 

Cheers

Ben
Reply all
Reply to author
Forward
0 new messages