Stitching untypical photo objects (reflective, people, analog scans)

76 views
Skip to first unread message

Abrimaal

unread,
Sep 2, 2016, 7:06:35 PM9/2/16
to hugin and other free panoramic software
Let's talk here what are the optimal settings (projection, CP detector etc.) for panoramas of untypical objects or photo techniques, to minimize the number of attempts.

1. Analog B/W photos. Two lucky shots taken from the same position, one after one. Both images were printed on paper and after 40 years scanned. Photos were scanned in 8-bit greyscale, 600 dpi. The paper was the same size but not in a perfect condition (slightly folded). I was trying all CP detectors, each of them failed. I removed all the CP, added them manually and again the same error.

2. Scenes with people or other moving objects. How many people were crippled or beheaded stitching in Hugin. Some other software has a possibility of graphical adjustment of the stitch lines. Is it possible in Hugin? Sometimes I take a photo for a panorama with a passing car or a human. I want to make two versions of the panorama - with and without the object.

3. Panoramas of cars and other reflective surfaces. The reason "why" is simple, often cars stand too close to each other or to a wall, to take a full photo.
The CP detectors find points in reflections of other cars, of buildings in the car surface, not in the "hard" parts and high contrasts. After deleting all the false points and matching "hard" points, there is always at least one error in the panorama. The camera was rotated around the nodal point as it was possible from the hand. How to minimize the risk of wrong stitch?

4. Partially solved. Straightening the car side views. Ideally a car should be photographed from the maximal distance, the smallest field of view, what means loss of quality. To straighten the side view I make copy of the photo, then I load both images and use Align Stack detector. I add the V-lines manually on buildings, not on
the car. The rectilinear projection usually makes the image stretched at the edges, what is visible that the wheels are not round. The adjustable Panini general seems to
be the best choice, but sometimes the final image requires re-scaling in another editor, it is too tall compared to its length.





bw_scans.jpg
adjust-stitch.jpg
hugin-car-ba.jpg
projection-car-side.jpg

Gnome Nomad

unread,
Sep 3, 2016, 3:33:06 AM9/3/16
to hugin and other free panoramic software
For #2, check out the mask feature. You can use masks to include or exclude areas of each image. That's basically how you influence the seam line placement, I think. Do a pano with the car in it and the pedestrian masked out. Save pano, save pano with a new name, then mask out the car and unmask the pedestrian.

Don't know anything about the others. You might check the Hugin tutorials site, wherever it is.

David

--
A list of frequently asked questions is available at: http://wiki.panotools.org/Hugin_FAQ
---
You received this message because you are subscribed to the Google Groups "hugin and other free panoramic software" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hugin-ptx+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hugin-ptx/e6b1f114-867c-43c0-b04c-27d1afd83bf0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sean Greenslade

unread,
Sep 3, 2016, 11:17:49 AM9/3/16
to hugi...@googlegroups.com
On Fri, Sep 02, 2016 at 04:06:34PM -0700, Abrimaal wrote:
> Let's talk here what are the optimal settings (projection, CP detector
> etc.) for panoramas of untypical objects or photo techniques, to minimize
> the number of attempts.
>
> 1. Analog B/W photos. Two lucky shots taken from the same position, one
> after one. Both images were printed on paper and after 40 years scanned.
> Photos were scanned in 8-bit greyscale, 600 dpi. The paper was the same
> size but not in a perfect condition (slightly folded). I was trying all CP
> detectors, each of them failed. I removed all the CP, added them manually
> and again the same error.

If you added CPs manually, don't try to run CPfind again. Just move on
to the optimization stage.

> 2. Scenes with people or other moving objects. How many people were
> crippled or beheaded stitching in Hugin. Some other software has a
> possibility of graphical adjustment of the stitch lines. Is it possible in
> Hugin? Sometimes I take a photo for a panorama with a passing car or a
> human. I want to make two versions of the panorama - with and without the
> object.

I agree with Gnome, use the masking tools. I generally only use exclude
regions to cut out obviously-wrong areas, as that leaves the blender
open to more options.

> 3. Panoramas of cars and other reflective surfaces. The reason "why" is
> simple, often cars stand too close to each other or to a wall, to take a
> full photo.
> The CP detectors find points in reflections of other cars, of buildings in
> the car surface, not in the "hard" parts and high contrasts. After deleting
> all the false points and matching "hard" points, there is always at least
> one error in the panorama. The camera was rotated around the nodal point as
> it was possible from the hand. How to minimize the risk of wrong stitch?

Manually inspect the CPs in highly-reflective areas. Make sure you
re-run the optimization before stitching, and pay attention to CPs that
have a high (over 1.0) error. If this error will not go away even with
full distortion parameter optimization and all good CPs, then there is
parallax. There is no real fix for parallax besides re-shooting the
photos or getting creative with photo manipulation.

> 4. Partially solved. Straightening the car side views. Ideally a car should
> be photographed from the maximal distance, the smallest field of view, what
> means loss of quality. To straighten the side view I make copy of the
> photo, then I load both images and use Align Stack detector. I add the
> V-lines manually on buildings, not on
> the car. The rectilinear projection usually makes the image stretched at
> the edges, what is visible that the wheels are not round. The adjustable
> Panini general seems to
> be the best choice, but sometimes the final image requires re-scaling in
> another editor, it is too tall compared to its length.

I'm afraid I don't really understand what you're doing in this example.
Can you provide an example picture set / pano of this?

--Sean

Stefan Peter

unread,
Sep 3, 2016, 12:19:08 PM9/3/16
to hugi...@googlegroups.com
On 03.09.2016 17:17, Sean Greenslade wrote:
> On Fri, Sep 02, 2016 at 04:06:34PM -0700, Abrimaal wrote:
>>
>> 1. Analog B/W photos. Two lucky shots taken from the same position, one
>> after one. Both images were printed on paper and after 40 years scanned.
>> Photos were scanned in 8-bit greyscale, 600 dpi. The paper was the same
>> size but not in a perfect condition (slightly folded). I was trying all CP
>> detectors, each of them failed. I removed all the CP, added them manually
>> and again the same error.
>
> If you added CPs manually, don't try to run CPfind again. Just move on
> to the optimization stage.

And it helps to have the lens specific parameters for the lens in use
saved as a default, sou you just need a handful of points to determine
yaw, pitch and roll (Optimize for position only).

>
>> 2. Scenes with people or other moving objects. How many people were
>> crippled or beheaded stitching in Hugin. Some other software has a
>> possibility of graphical adjustment of the stitch lines. Is it possible in
>> Hugin? Sometimes I take a photo for a panorama with a passing car or a
>> human. I want to make two versions of the panorama - with and without the
>> object.
>
> I agree with Gnome, use the masking tools. I generally only use exclude
> regions to cut out obviously-wrong areas, as that leaves the blender
> open to more options.

Additionally, use Edit->Remove control points in masks after defining
your exclusion masks.

>> 4. Partially solved. Straightening the car side views. Ideally a car should
>> be photographed from the maximal distance, the smallest field of view, what
>> means loss of quality. To straighten the side view I make copy of the
>> photo, then I load both images and use Align Stack detector. I add the
>> V-lines manually on buildings, not on
>> the car. The rectilinear projection usually makes the image stretched at
>> the edges, what is visible that the wheels are not round. The adjustable
>> Panini general seems to
>> be the best choice, but sometimes the final image requires re-scaling in
>> another editor, it is too tall compared to its length.

I have no idea here. It may be the field of view optimized by hugin is
wrong (maybe due to problems mentioned above) or your cropping
parameters are wrong or anything else.
Your pto and the images for it, provided on a service like dropbox, may
yield more and usually very competent feedback, though. Please do not
try to send your files as an attachment to this list: It will not work
and it may infuriate list participants.

With kind regards

Stefan Peter

--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
(See https://en.wikipedia.org/wiki/Posting_style for details)

Abrimaal

unread,
Sep 3, 2016, 8:43:54 PM9/3/16
to hugin and other free panoramic software, s_p...@swissonline.ch

Ad 2.


> I agree with Gnome, use the masking tools. I generally only use exclude
> regions to cut out obviously-wrong areas, as that leaves the blender
> open to more options.

>Additionally, use Edit->Remove control points in masks after defining
>your exclusion masks.

Yes, this is the solution. I experimented with cropping images or blackening the unwanted fragments before making a panorama, but the mask is that what I needed.

Ad 4.
The car side view is not a panorama. This is an image stack made from the original image and its copy.

Sean Greenslade

unread,
Sep 4, 2016, 11:21:50 AM9/4/16
to hugi...@googlegroups.com
On September 3, 2016 8:43:54 PM EDT, Abrimaal <abri...@wp.pl> wrote:
>Ad 4.
>The car side view is not a panorama. This is an image stack made from
>the
>original image and its copy.

Are you simply trying to adjust the perspective of the image? If so, you might be able to get away with a normal photo editing tool like GIMP. If not, can you supply an example .pto and image file so we can see what you are trying to achieve?

--Sean



Abrimaal

unread,
Sep 4, 2016, 7:55:49 PM9/4/16
to hugin and other free panoramic software
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.
volkswagen-bora-20140322-b-mc-yel-ur-pah-p.pto
volkswagen-bora-20140322-b-mc-yel-ur.jpg

Sean Greenslade

unread,
Sep 5, 2016, 1:45:52 PM9/5/16
to hugi...@googlegroups.com
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

bugbear

unread,
Sep 6, 2016, 4:32:32 AM9/6/16
to hugi...@googlegroups.com
Sean Greenslade wrote:
> 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.

The subject doesn't need to be very 3D to cause this;
I took an off-axis photo of a gothic carved panel in a church,
to avoid a reflection.

Skewing the panel back to rectlinear caused the carving
too look "odd" in a non-obvious way.

http://galootcentral.com/components/cpgalbums/userpics/10152/gothic.JPG

BugBear

Reply all
Reply to author
Forward
0 new messages