Aligning 2nd Image Control Points to Match 1st Image

138 views
Skip to first unread message

Meowly Bear

unread,
Apr 15, 2021, 1:40:43 PM4/15/21
to hugin and other free panoramic software
Hello All,

Just looking for a simple way to do this non-pano work.

I have 2 pictures of a building taken 20 years apart. The angle of the newer second image doesn't exactly match the older image.

I would like to insert control points in Image 2 to match the perspective and camera angles of the older Image 1, and output only the corrected newer Image 2.

Thanks in advance for your assistance.

Bruno Postle

unread,
Apr 15, 2021, 5:12:51 PM4/15/21
to Hugin ptx
On Thu 15-Apr-2021 at 10:33 -0700, Meowly Bear wrote:
>
> Just looking for a simple way to do this non-pano work.
>
> I have 2 pictures of a building taken 20 years apart. The angle of
> the newer second image doesn't exactly match the older image.
>
> I would like to insert control points in Image 2 to match the
> perspective and camera angles of the older Image 1, and output
> only the corrected newer Image 2.

This is only going to give satisfactory results if both photos were
taken at more-or-less the same spot.

You will need to use the Panorama Editor, the Preview window doesn't
offer enough options. Load the 'anchor' photo first and set the
roll, pitch and yaw to zero, create control points, and optimise
'positions and view'. The 'anchor' photo should stay in place and
the other photo should move to fit.

In the Stitcher tab, set the output projection to rectilinear, but
before stitching select the 'remapped images' option. The will save
the images you want as TIFF files (usually they are deleted after
blending).

My experience to trying this with old photos is that you should
switch it around. You know the parameters of your new photo, so this
should be your anchor, old photos have unknown lenses and are often
cropped asymmetrically (which Hugin can deal with using the d,e
parameters).

--
Bruno

Meowly Bear

unread,
Apr 16, 2021, 6:32:34 AM4/16/21
to hugi...@googlegroups.com
Hi Bruno,

Thank you for your reply.

Unfortunately, I can't seem to make it work - probably because I'm doing this wrong.

These are the two pictures.

1. I set Hugin INTERFACE to Expert.
2. ADD IMAGE: Old picture (this will be the anchor)
3. Double click on the filename. That opens up IMAGE VARIABLES. Under POSITIONS, I ensure Yaw, Pitch & Roll = 0. Hit Okay.
4. ADD IMAGE: New picture
5. Then I hit CONTROL POINTS.
6. On the Left Panel is the Old picture. On the Right I select the New Picture.
7. I match and ADD as many as 30 points between the left & right pictures.

Then this is where I get lost. Am I supposed to go back to PHOTOS tab, then highlight both the New & Old pics, and hit Optimise Geometric (Positions & View) Calculate?
Leave Feature Matching Setting: cpfind ?
And then move to STITCHER tab, PROJECTION (Rectilinear)?
Remapped Images select all three boxes and then hit STITCH?

When I do that, it tells me it could not output as no images are selected.

What am I doing wrong? Thank you in advance.


--
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/YHisTgbrKAXTKBtJ%40postle.net.

Monkey

unread,
Apr 16, 2021, 7:45:20 AM4/16/21
to hugin and other free panoramic software
There's quite a large difference in geometry which I think Hugin is going to unable to fully correct. Can you upload your .pto file? I have a video plugin that should be able to warp one image to the other using the control points in the file.

Meowly Bear

unread,
Apr 17, 2021, 7:20:39 AM4/17/21
to hugi...@googlegroups.com
Hi,

Here is the slightly lower res version of the two pictures, together with the .pti file. I'm trying to match the Capitol Theatre with the old picture angle. Thanks :)

1 Old150.jpg

Capitol.pto

dkloi

unread,
Apr 17, 2021, 10:41:12 AM4/17/21
to hugin and other free panoramic software
Here's my attempt. I manually tried to match points on the building  but because there has been a lot of renovation to the frontage, as well as large tree in the way obscuring key bits of the building, I don't expect the match to be great.

Daniel

2 NewJPG - 1 Old.pto

Meowly Bear

unread,
Apr 17, 2021, 12:04:59 PM4/17/21
to hugi...@googlegroups.com
Hi,

Thank you so much! 

Where exactly was I going wrong in the process?:

1. I set Hugin INTERFACE to Expert.
2. ADD IMAGE: Old picture (this will be the anchor)
3. Double click on the filename. That opens up IMAGE VARIABLES. Under POSITIONS, I ensure Yaw, Pitch & Roll = 0. Hit Okay.
4. ADD IMAGE: New picture
5. Then I hit CONTROL POINTS.
6. On the Left Panel is the Old picture. On the Right I select the New Picture.
7. I match and ADD as many as 30 points between the left & right pictures.

Then this is where I get lost. Am I supposed to go back to PHOTOS tab, then highlight both the New & Old pics, and hit Optimise Geometric (Positions & View) Calculate?
Leave Feature Matching Setting: cpfind ?
And then move to STITCHER tab, PROJECTION (Rectilinear)?
Remapped Images select all three boxes and then hit STITCH?

When I do that, it tells me it could not output as no images are selected.

Thanks.


You received this message because you are subscribed to a topic in the Google Groups "hugin and other free panoramic software" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/hugin-ptx/AMBXVuOMZSk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to hugin-ptx+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hugin-ptx/830f1ec8-dc9b-4636-8a6a-0276d097459dn%40googlegroups.com.

Bruno Postle

unread,
Apr 17, 2021, 3:47:00 PM4/17/21
to Hugin ptx
On Sun 18-Apr-2021 at 00:04 +0800, Meowly Bear wrote:
>Thank you so much!
>
>Where exactly was I going wrong in the process?:
>
>1. I set Hugin INTERFACE to Expert.
>2. ADD IMAGE: Old picture (this will be the anchor)
>3. Double click on the filename. That opens up IMAGE VARIABLES. Under
>POSITIONS, I ensure Yaw, Pitch & Roll = 0. Hit Okay.
>4. ADD IMAGE: New picture
>5. Then I hit CONTROL POINTS.
>6. On the Left Panel is the Old picture. On the Right I select the New
>Picture.
>7. I match and ADD as many as 30 points between the left & right pictures.
>
>Then this is where I get lost. Am I supposed to go back to PHOTOS tab, then
>highlight both the New & Old pics, and hit Optimise Geometric (Positions &
>View) Calculate?

Yes, this is equivalent to the align step.

>Leave Feature Matching Setting: cpfind ?

You don't need this because you have already set control points.

>And then move to STITCHER tab, PROJECTION (Rectilinear)?

Yes, Hugin defaults to equirectangular, which is a 360 spherical
panorama projection. But you need the output to be rectilinear,
which is the projection of a 'normal' photo. Switching from
equirectangular to rectilinear may look

>Remapped Images select all three boxes and then hit STITCH?
>
>When I do that, it tells me it could not output as no images are selected.

What do you see in the preview window? You should see the two
photos overlaid on each other.

--
Bruno

dkloi

unread,
Apr 17, 2021, 4:57:00 PM4/17/21
to hugin and other free panoramic software
My process (Expert Interface):
1. Import both photos, set the new photo as anchor. Make sure they both have different lenses
2. Manually add vertical control points to both images
3. Manually add control points between the two images
4. Set the optimise:geometric dropdown to custom parameters
5. Go to the optimiser tab
6. On the New photo, tick the roll and pitch boxes, everything else unticked
7. On the Old photo, tick, the yaw, roll, and pitch boxes. Also tick the HFOV for the lens for the Old photo. Press Optimise Now button
8. Check the result in the Preview Panorama window. Centre and Fit the pano. You may also want to optimise the size of the output in the Stitcher tab, also setting the projection to what you want (e.g rectilinear)
9. Now play around with different boxes for the lens for the Old photo, optimising as you go along, maybe undoing if it doesn't give a good result. I generally do not twiddle with the New photo position or lens parameters.
10. You can try adding more control points or adjusting the existing ones. Use the control point table to check what points have large errors. I use the Preview Panorama window and rapidly switch between overlaying one photo over the other to check if they visually match.
11. If/when you are satisfied, export the pano by hitting the stitch button on the Stitcher tab. Select which photo you want to include in the pano by going to the Preview Panorama window and ticking them beforehand.

See if this works for you.

Terry Duell

unread,
Apr 17, 2021, 6:51:14 PM4/17/21
to hugi...@googlegroups.com
Hello Meowly,

On Sat, 2021-04-17 at 19:20 +0800, Meowly Bear wrote:
> Hi,
>
> Here is the slightly lower res version of the two pictures, together with
> the .pti file. I'm trying to match the Capitol Theatre with the old picture
> angle. Thanks :)
>
> 1 Old150.jpg

Please don't post large attachments directly to mailing lists, not everyone
wants to receive the attachment.
It's always good etiquette to put your attachment on a cloud service (Dropbox or
similar) where those that want to can retrieve it.

Cheers,
--
Terry Duell <tdu...@iinet.net.au>

Message has been deleted
Message has been deleted

Monkey

unread,
Apr 18, 2021, 8:54:18 AM4/18/21
to hugin and other free panoramic software
> Please don't post large attachments directly to mailing lists, not everyone
> wants to receive the attachment.
> It's always good etiquette to put your attachment on a cloud service (Dropbox or
> similar) where those that want to can retrieve it.

But not Imgur, I'm guessing? Because I've tried to post a message containing an Imgur link twice now in reply to this thread, and it's been seemingly auto-deleted both times...

Monkey

unread,
Apr 21, 2021, 4:54:08 PM4/21/21
to hugin and other free panoramic software
Strange. My two deleted messages from 3-4 days ago both appeared in my group digest email this morning.

Anyway, he's a different link to the image I was trying to link to:

Bruno Postle

unread,
Apr 22, 2021, 2:34:28 AM4/22/21
to hugi...@googlegroups.com
There probably is an issue with Imgur. Your two messages were in a 'moderation queue', but the notifications for these seem to be delayed compared to normal 'new subscriber' moderation notifications - Bruno


On 21 April 2021 21:54:08 BST, Monkey wrote:
>Strange. My two deleted messages from 3-4 days ago both appeared in my
>group digest email this morning.
>
Reply all
Reply to author
Forward
0 new messages