Mildly off topic - rephotography?

112 views
Skip to first unread message

paul womack

unread,
Feb 8, 2016, 4:40:15 AM2/8/16
to hugi...@googlegroups.com
There was a lot of noise a while back (good $DEITY, it was 2010)
about some software at MIT that helped get the camera
into the right place;

http://www.geek.com/news/new-camera-software-allows-you-to-line-up-your-photos-with-the-past-1272643/

(full paper: http://people.csail.mit.edu/soonmin/rephoto/rephoto.pdf)

But I can't find any information that falls *BETWEEN* the 2
extremes of "keep moving tilll you get it right" and the MIT software.

Does anyone know of any other guides to technique and/or software aids?

I'm guessing lining up old and new photos might be mildly relevant to Hugin.

BugBear

Rogier Wolff

unread,
Feb 16, 2016, 9:26:24 AM2/16/16
to hugi...@googlegroups.com
Occasionally I too wonder if things couldn't be done better. In my
local newspaper there is a column where they show an old and new
photograph. Sometimes they get it quite right, sometimes almost....

I think that to gather enough information you would need to build a 3D
model from the environment by taking a bunch of pictures with several
viewpoints in the general area of where the old one was taken. Then,
by matching the remaining buildings in th eold photograph to the 3D
model you can calculate the camera position of the old photograph
compared to the new images. Provided you've kept a precise log of
where you took the "set of photographs for the 3D model", you should be
able to calculate where to stand for the "NOW" picture...

If hugin is capable of helping, it would be through the "XYZ offset"
settings. Take a picture, import into hugin. Then, IIRC the XYZ offset
system, you will have to make "a plane, say the front of a building"
into the Z=0 plane. Check that everything on the building comes out
straight and perpendicular when you create a projection on Z=0. Then
when you match the old photograph to your new one, it should give you
XYZ offset numbers....

An important parameter that needs to go into this would be the lens
parameters for the old photograph. If that old photograph contains
enough information about that in the picture itself (which is likely
the only thing you have), remains to be seen.....

Interesting subject.... :-)

Roger.
>
> BugBear
>
> --
> 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/56B86279.7070809%40papermule.co.uk.
> For more options, visit https://groups.google.com/d/optout.
>

--
** R.E....@BitWizard.nl ** http://www.BitWizard.nl/ ** +31-15-2600998 **
** Delftechpark 26 2628 XH Delft, The Netherlands. KVK: 27239233 **
*-- BitWizard writes Linux device drivers for any device you may have! --*
The plan was simple, like my brother-in-law Phil. But unlike
Phil, this plan just might work.

bugbear

unread,
Feb 16, 2016, 10:19:06 AM2/16/16
to hugi...@googlegroups.com
Rogier Wolff wrote:

>
> I think that to gather enough information you would need to build a 3D
> model from the environment by taking a bunch of pictures with several
> viewpoints in the general area of where the old one was taken. Then,
> by matching the remaining buildings in th eold photograph to the 3D
> model you can calculate the camera position of the old photograph
> compared to the new images. Provided you've kept a precise log of
> where you took the "set of photographs for the 3D model", you should be
> able to calculate where to stand for the "NOW" picture...

That's way more complex than I was thinking of.

(see attached diagram, which is 2D, concerned with placing
the camera correctly on a plane)

I think it is obvious that if the landmarks in an old photo
lined up so perfectly as the top left example, it would be easy
to simply walk to the right place; to be formal, you could put
yourself on the line defined by the left hand pair of landmarks,
and then walk up and down it, until you're also on the line
formed by the right hand pair.

The top right example is a little more complex. Instead of the landmarks
simply lining up, you have place each "near" landmark of the landmark triples
exactly between the pair of "far" landmarks. Other than that, it's the same as the first example.

The bottom left example generalises still further, so that the "near" landmarks are now at different
distances from their respective "far" landmark base lines.

We generalise this further, so that instead of the "near" mark being centred between the
two "far" marks, it simply has to be placed (or, more accurately, the camera placed) so that
the gaps between the "left far", "near", and "right far" are in some ratio other than 1:1
In the bottom right case, these ratios are 2:1 and 3:1.

All of this clearly works. So - in this last, most general case, it seems
plausible that "all" we have to do is pick out some "well chosen" landmarks and ratios
from the original target image.

So - what's the MINIMUM set of landmarks and ratios and what criteria do they
need to fulfil such that 2D placement of the camera is possible?

(and, having taken a trial photograph and calculated your new ratios from it,
how do you calculated the "move" the camera needs to make ? )

BugBear

bugbear

unread,
Feb 16, 2016, 10:20:01 AM2/16/16
to hugi...@googlegroups.com
bugbear wrote:

> (see attached diagram, which is 2D, concerned with placing
> the camera correctly on a plane)

Here's the diagram I was obviously referring to,
but was too stupid to attach!

BugBear

rephoto.png

Robb Campbell

unread,
Nov 27, 2019, 8:23:07 AM11/27/19
to hugin and other free panoramic software

Let me take a crack at this old thread, which I think is very on-topic for Hugin etc.

So, can/should someone wanting to align rephotographs use Hugin?

Of course what I want is to register my new photos to the old ones (i.e. stretch the new pixels so they will align to the old image and lie right on top of it). That's almost exactly what Hugin does, and Hugin even finds "control points" (i.e. spots where the two images match) automatically-- but it seems Hugin is made to assume, say, a 10% overlap instead of a 90% overlap. In other words, stitching is a form of registration.

But when I try this in Hugin I get bizarre results. Are there instructions for this that I have overlooked? Or could the program be slightly modified to make this more convenient? Or would that just duplicate some other program that I have likewise overlooked?

For now I use QGIS (a cartography program) to align new to old the way you'd align, say, a satellite image to a map. But of course it's so slow picking points manually. It might literally take ten or a hundred times as long.

By the way (I'll say though this might be obvious) when you do a simple alignment in something like QGIS (say, a first-degree polynomial transform) the "error" arrows (showing where the computer moved your control points to) often show you whether your camera was too far left or right, and even too close or far away. E.g. if I reshoot a hill in front of a mountain and the computer "wants" to pull the foreground hill to the right to align with the mountain, then my camera was too far to the right. If the computer "wants" to pull the hill down then I was too close. That's an old form of "computational rephotography."

Really, I'm surprised that by 2019 there's not some program that lets me drag an image onto a similar image and shhp! it aligns to the old. Or have I missed that too?

I hope this is a constructive question. Thanks.

Bruno Postle

unread,
Nov 27, 2019, 12:27:43 PM11/27/19
to hugi...@googlegroups.com


On 27 November 2019 12:47:12 GMT, Robb Campbell wrote:
>
>Let me take a crack at this old thread, which I think is very on-topic for
>Hugin etc.
>
>So, can/should someone wanting to align rephotographs use Hugin?
>
>Of course what I want is to register my new photos to the old ones

Nooo (see below)

I've have been shooting a few of these lately, basically a Panini projection panorama gives nice background context for the usually very narrow angle of view old photo. I'll attach one.

Some tips:

Don't try and optimise the new photo to fit the old photo, you already know the correct parameters for your camera so there is no need to change them. Optimise the old photo to fit the new.
If you want the old photo undistorted in the result, then use the Hugin tools to align the scene before stitching.

Old photos are almost always severely cropped, so you will need to optimise d&e parameters to recenter them.

Old lenses tended to have very narrow angle of view, one result of this is that the photographer usually stood as far back as possible - if in doubt about the right camera position, walk backwards until you can't go any further.

Old photos tend not to be taken at head height, tripods were short, so go low.

Usually the first attempt at matching a scene is a mess, but by attempting to stitch the project you will get a good idea of where you need to stand when you go back. i.e. do a local scene that is easy to return to.
You could use Hugin XYZ parameters and a flat plane that exists in both scenes to figure out exactly where to stand on the second attempt. I've never tried this, but I think it is doable.

Blending an old photo into a Hugin panorama results in weird seam lines. Usually you just want the entirely of the old photo on top of the panorama. You can do this by placing an include mask over the whole old photo, or save the 'remapped images' when stitching and paste everything together in an image editor.

--
Bruno
IMG_20191127_164859.jpg
IMG_20191127_164932.jpg

Luís Henrique Camargo Quiroz

unread,
Nov 27, 2019, 5:03:16 PM11/27/19
to hugi...@googlegroups.com

   Very great tips Bruno!  Thanks a lot!

  Luís Henrique

--
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.


--

Robb Campbell

unread,
Dec 16, 2019, 8:43:23 AM12/16/19
to hugin and other free panoramic software

Thanks for the comments. The XYZ idea sounds pretty interesting.

For anyone reading this later, after reading around, upgrading, and again trying Hugin to stack a few ordinary rephotos, my answer is what it was years ago, that no, you should almost certainly not use a stitcher program like Hugin to stack rephotos.

First because a stitcher is intended for images that are almost identical. The reason to try a stitcher to get automatically generated control points, but as people have pointed out, these automatic algorithms usually fail when the images are many years apart and thus quite different.

Second because a program like Hugin is just complex. You're driving a tank to the grocery store. It's more of a "buff" program, for people who enjoy the time in the weeds and the details, not for the masses (small masses?) who just want to align one image to another. Those people with the Apple I computers really enjoyed soldering the keyboard or whatever, but I would never send a bunch of students off to use an Apple I.

So if there's a path to mass rephotography I doubt it runs through this. It's like needing an awl, having no awl, so choosing between a chisel and a screwdriver. For now (2019) I'd try re.photos or a GIS like QGIS.

Thanks,

Robb Campbell

Reply all
Reply to author
Forward
0 new messages