Unwarping an almost-mosaic of sword

44 views
Skip to first unread message

Mark Stoutjesdijk

unread,
Feb 3, 2026, 1:30:39 AMFeb 3
to PTGui Support
Hi,

I photographed a Japanese sword (naginata, actually), and managed to get VERY decent stitching. Unfortunately, even with a lens focal distance override of 4000mm, I still get a significant warp in the resulting image. See the attached small JPG.

There is a ruler in the image, and "all" I think I need to do is straighten that. Messing around with photo tools like Affinity took a lot of time and ended with disappointing results.

I'm hoping someone can point me in the right direction to fix this. It would be ideal if I would only need to adjust a setting in PTGUI. But any other tool that I could use to straighten the ruler in the bottom of the panorama would be great as well.

Best, Mark
Naginata_S.jpg

PTGui Support

unread,
Feb 3, 2026, 3:49:54 AMFeb 3
to pt...@googlegroups.com
Hi Mark,

Mosaics can be tricky to stitch, they only work if the subject is
completely flat. Any depth will cause parallax. Parallax generally will
cause unfixable stitching errors and it will also cause the optimizer to
overcompensate by adjusting parameters in an unwanted way, which is
what's happening here.

Ideally all control points should be placed in a flat plane,
perpendicular to the camera. You could try placing all control points on
the background surface only. This would lead to misalignments on the
sword's surface but perhaps they are not noticable.

Another thing you could try is to force the optimizer to use the same
roll angle for all images. Switch to Advanced mode, go to the Optimizer tab:
- switch to Advanced optimizer
- Optimize globally: only Fov,a,b,c. Disable shift
- For all images except the middle one: optimize only yaw and pitch, not
roll. For the middle image optimize nothing.
- Go to Lens Settings and press the Reset Button next to Lens Correction
- Go to Image Parameters and set all Roll angles to zero
- Then run the Optimizer (press F5)

I assume this will lead to a straight image, but there will be stitching
errors. It's a trade off.

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 visit https://groups.google.com/d/msgid/ptgui/
> a31e4ac9-3459-4648-aff1-8088ba9226f4n%40googlegroups.com <https://
> groups.google.com/d/msgid/ptgui/a31e4ac9-3459-4648-
> aff1-8088ba9226f4n%40googlegroups.com?utm_medium=email&utm_source=footer>.

John Houghton

unread,
Feb 3, 2026, 4:34:20 AMFeb 3
to PTGui Support
Mark, I tried using Photoshop's Transform tools on your image, but correcting the irregular distortions is very difficult and the result (attached) is not really adequate.

John

Naginata_S_ed.jpg

Mark Stoutjesdijk

unread,
Feb 3, 2026, 8:14:28 AMFeb 3
to PTGui Support
Thanks John. Indeed, I'll have to look for other solutions. Will try first with Joost's suggestions.

Erik Krause

unread,
Feb 3, 2026, 10:24:26 AMFeb 3
to pt...@googlegroups.com
Am 02.02.26 um 23:03 schrieb Mark Stoutjesdijk:

> I photographed a Japanese sword (naginata, actually), and managed to get
> VERY decent stitching.

If you shoot the naginata with a long focal length from a distance
rotating around the no-parallax-point (like a normal panorama), there
should be no problems to stitch at all.

--
Erik Krause
Herchersgarten 1
79249 Merzhausen

Mark Stoutjesdijk

unread,
Feb 3, 2026, 3:15:41 PMFeb 3
to PTGui Support
Joost, the settings you recommend do lead to a straight ruler, plus the contours are very nicely fixed by the algorithm (see attach). But there is a varying amount of X and Y-direction stretching going on. A centimeter is not a centimeter. For example, the tang is visually bent while it should be straight. As you said, a trade-off.
Erik, my long focal distance lens is (for MFT) pretty hefty, almost 14cm long. That seems a bit longer than most panoramic heads? I have no experience with those units, but so far I have found that big is expensive (and I would use it only sparingly).
OK, the search goes on!
Naginata_260202_205121 Panorama ura j.jpg

PTGui Support

unread,
Feb 4, 2026, 3:41:09 AMFeb 4
to pt...@googlegroups.com
Yes it's very obvious at 94cm. Either the optimizer has introduced a
hefty lens distortion correction in order to reduce the control points
error, or perhaps your camera is not exactly perpendicular to the
surface. So the left side of the image is farther away than the right side.

There's another method for stitching mosaics (see
https://ptgui.com/faq#6_5) by letting PTGui use the actual focal length
of the lens, and enabling viewpoint correction. This can cope with any
camera orientation, not necessarily perpendicular. But in presence of
parallax it will have the same tendency to create a non-square image
because the optimizer now has many more parameters to play with.

To shoot from the no-parallax point, a panoramic head is not absolutely
necessary, you could also try eyeballing the NPP position and moving the
tripod accordingly. For tele lenses it's difficult to determine the
exact NPP but as far as I know it's usually near the front of the lens.
Keep in mind that you currently have 20(?) cm of parallax, I guess you
can reduce it to less than 1cm with some effort.

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 visit https://groups.google.com/d/msgid/
> ptgui/41f9ad7c-5c90-4ce1-ad7f-bb9292f6c4c3n%40googlegroups.com <https://
> groups.google.com/d/msgid/ptgui/41f9ad7c-5c90-4ce1-ad7f-
> bb9292f6c4c3n%40googlegroups.com?utm_medium=email&utm_source=footer>.

John Houghton

unread,
Feb 4, 2026, 4:10:58 AMFeb 4
to PTGui Support
On Wednesday, February 4, 2026 at 8:41:09 AM UTC PTGui Support wrote:
For tele lenses it's difficult to determine the
exact NPP but as far as I know it's usually near the front of the lens.

Actually, the npp is usually nearer the back of the lens, and sometimes inside the camera body.  It's easy to estimate its position simply by pointing the rear of the lens towards a light source and looking into the lens with your two eyes, preferably with the lens stopped down to a small aperture (if that's possible).  Put your fingers on the barrel and move them along until they appear to be at the same distance - at the npp.  Of course, it's the position of the npp that's important for positioning the lens on the panorama head, so a long lens doesn't necessarily need a large panorama head.

John

John Houghton

unread,
Feb 4, 2026, 4:17:35 AMFeb 4
to PTGui Support
For clarity, I should have mentioned that the npp is located at the bright disc of the aperture that you see when looking into the lens.  Rotate the camera about this point to minimise parallax.

John

Reply all
Reply to author
Forward
0 new messages