On Sun, Sep 04, 2016 at 04:55:49PM -0700, Abrimaal wrote:
> I attach the .pto file and the image resized to 900px wide, the original is
> about 5MB 3456 x 2304 px. The name of the 2nd file is the same, with _COP
> at the end.
>
> The car was photographed not directly from its centre, you can see my
> reflection in the rear door. That made the front of the car smaller than
> the rear. I want to fix it using mathematical metods of Hugin, by
> straightening the V and H lines and angles of the building behind. This is
> a kind of perspective that requires to be adjusted mainly horizontally.
> Sometimes I use GIMP for adjusting perspective of architecture, but this is
> a very arbitrary method. The grid in GIMP that is distorted together with
> the image, does not help with the work (as the whole freaky UI of GIMP).
> Since I had started to use Hugin to straighten buildings mathematically
> with surprisingly good results, I am trying to use this method for cars
> with buildings or other vertical lines behind. If I make the lines of the
> windows and the angles straight, the car should return to its real
> proportions.
OK, I had a play with your image and project. Here are my suggestions:
For what you're trying to achieve, I don't think you need two copies of
the image. Simply placing one image, adding horizontal / vertical
control points, optimizing, and projecting should work.
Switch the geometric optimizer to custom, then set the image to only
optimize pitch and roll. Pitch optimization will try to correct vertical
centering errors, while yaw will try to correct horizontal centering
errors. If you want to correct both, you may try optimizing only one at
a time. Without other images to anchor it down, optimizing everything at
once is liable to move the image all over the place.
I tried rectilinear, panini, and architectural projections. If you
haven't tried architectural, give it a look. It seemed to do a little
less of the bowed-in look that the rectilinear did without stretching it
vertically as much as the panini. But of course, with something like
this, it ultimately comes down to personal taste. Use whichever looks
the best to you.
As an interesting side note, I actually wrote some software back in
college for a robotics application that did a rectilinear -> rectilinear
perspective transform on a live webcam feed. It would take a target
shape and "flatten" it out. It worked really well on purely 2D objects,
but started to look weird whenever 3D objects entered the frame. This
comes back down to the parallax issue: image transforms can't alter the
parallax of the image, so there will be some oddities in any output if
the input picture isn't of something completely flat.
--Sean