I presume you are photographing flat objects using a camera mounted on a rail.
Hugin is primarily designed to work stitching panoramas taken from a single point, so it tries to project the images into a sphere. Now, when making photos of flat objects from a rail, such projection results in distorted images, so you need to change a few of the default settings for Hugin.
The most important one is to trick Hugin into working with a lens with a very small field of view, as if you were using a very long telephoto lens. So change the the lens for your images to have a 10 or 5 degree field of view. Then use custom parameters for Optimization to use Roll, tX and tY only, and disable Yaw and Pitch optimization.
Also make sure that the projection is set to rectilinear
The main procedure is outlined in this very old tutorial. The interface has changed a bit, but the functions and procedure is still the same.
here's another tutorial that might be useful
or