The old PTStitcher tool contained a ‘morph-to-fit’ option that helps with stitching panoramas with parallax errors. This had various issues, ptomorph is a command-line tool to get better morphing with Hugin.
ptomorph is available with Panotools::Script 0.27. The morphing itself is done with ImageMagick.
What it does is read all the control points in an existing PTO project, and use these to generate a ‘morph’ distortion for each photo that results in all the control points lining up exactly.
Here are ‘before and after’ examples of handheld panoramas with quite a lot of stitching errors: