Units of TrX, TrY, and TrZ?

92 views
Skip to first unread message

Sean McHone

unread,
Apr 15, 2021, 3:13:50 PM4/15/21
to hugin and other free panoramic software
I'm using Hugin to align images from multiple cameras. Secondary cameras are mounted at a known offset from the primary camera.    I'm trying to use TrX, TrY, and TrZ to account for those offsets. Could someone tell me what the units are for those translation variables?  Do those translation variables relate directly to the position of the secondary camera's entrance pupil relative to the primary camera's entrance pupil? 

Bruno Postle

unread,
Apr 15, 2021, 4:55:47 PM4/15/21
to Hugin ptx
Yes, imagine that the output canvas is a projection screen and that
each photo is being projected onto this screen from a position in
space defined by these TrX, TrY and TrZ coordinates.

The default 0, 0, 0 location is exactly 1 unit distance from this
screen. So, if you change TrZ of a photo to -0.5, the 'projector'
is moving closer to the screen, and the image in the canvas view is
half the size. If you set TrZ to -1 then the projected image is so
small that you can't see it (the output canvas viewpoint always
stays at 0, 0, 0)

A photo with an angle of view of 90 degrees placed at 0, 0, 0 will
project an image onto the screen 2 units wide. A similar photo
placed at TrX = 2 will be shifted just far enough that the two
projected images sit side-by-side.

Hope this makes sense, it is a bit of a boggle, I suggest you open
the Preview window, set output projection to rectilinear with a wide
angle of view, and try moving the position of a photo around as
described above.

--
Bruno

SRM

unread,
Apr 15, 2021, 5:48:47 PM4/15/21
to hugin and other free panoramic software
It does make sense. I've been doing just that and am getting close to what I want to see, but I'd like to be a bit more precise with respect to this variable.  Is there some way I can use the real word physical measurements I do know to calculate the correct offsets to apply to TrX and TrZ  for the 1unit sphere projection?  Specifically I have a secondary camera who's entrance pupil was physically located at -3.6" in the TrX direction and +1.6" in the TrZ direction with a Yaw of 48.9 relative to the primary camera who's corresponding location and yaw are zero. Isn't there some sort of formula I can apply to get an accurate TrX and TrZ value that applies to the 1 Unit Sphere?   Perhaps the horizontal view angle of all the cameras (49.95 deg) would be a pertinent variable in such an equation?

Bruno Postle

unread,
Apr 16, 2021, 2:43:59 AM4/16/21
to hugi...@googlegroups.com
You divide the relative coordinates (in inches) by the distance (in inches) of the 'anchor' image from the projection plane - this gives TrX etc. values which are unitless.

If you don't know the distance to the projection plane, then Hugin can calculate it for you. Estimate the distance and divide the coordinates as above, then optimise just the TrZ values of all photos in the project.

--
Bruno

SRM

unread,
Apr 16, 2021, 11:41:07 AM4/16/21
to hugin and other free panoramic software
Hey Bruno,
I really appreciate your help on this.    Unfortunately I am not finding where Hugin will calculate the distance to the projection plane.  
I am sorry I have to ask for your assistance again...but how/where do I get Hugin to calculate the distance to the anchor image projection plane.
Thanks again,
Sean

Bruno Postle

unread,
Apr 17, 2021, 3:31:04 PM4/17/21
to Hugin ptx
The distance from the TrX, TrY, TrZ = 0,0,0 position to the canvas
plane is always 1. So if you lock the position of one of the photos
to 0,0,0, you can ask the Hugin optimiser to try and find a position
for the other photo that agrees with the control points in the
project.

In the Photos tab you need to select 'custom parameters', and
optimise TrX and TrZ of the second photo (assuming that you have set
the yaw for this to 48.9 and don't need to optimise it). If this
results in a value for TrX of 0.1, given that this equates to 3.6"
in real world units, then the distance from the first photo to the
canvas plane is 3.6/0.1 = 36".

Keep asking if this isn't working for you, this is a legitimate task
for Hugin, but it isn't easy conceptually, it would be nice to have
a good explanation, diagram or even some code that makes it easier.

--
Bruno

On Fri 16-Apr-2021 at 08:41 -0700, SRM wrote:
>Hey Bruno,
>I really appreciate your help on this. Unfortunately I am not finding
>where Hugin will calculate the distance to the projection plane.
>I am sorry I have to ask for your assistance again...but how/where do I get
>Hugin to calculate the distance to the anchor image projection plane.

>On Friday, April 16, 2021 at 1:43:59 AM UTC-5 bruno...@gmail.com wrote:
>
>> You divide the relative coordinates (in inches) by the distance (in
>> inches) of the 'anchor' image from the projection plane - this gives TrX
>> etc. values which are unitless.
>>
>> If you don't know the distance to the projection plane, then Hugin can
>> calculate it for you. Estimate the distance and divide the coordinates as
>> above, then optimise just the TrZ values of all photos in the project.
>>

jmuc...@gmail.com

unread,
Apr 26, 2021, 9:53:56 AM4/26/21
to hugin and other free panoramic software
Just chiming in to note that an explainer like this would be lovely to have in docs somewhere, if it isn't already.

Bruno Postle

unread,
Apr 28, 2021, 8:18:24 AM4/28/21
to hugin and other free panoramic software
It still doesn't feel like a particularly good explanation, I have
trouble following it and I wrote it. I thought that maybe the mosaic
mode in the preview overview could be modified to show all the camera
positions in 3d, but then the panotools model allows multiple mosaic
planes (with the plane yaw and plane pitch parameters, yes this is
really hard to visualise), so I don't think this would make anything
clearer, it would just add extra confusion.

--
Bruno

On Mon, 26 Apr 2021 at 14:54, jmuc...@gmail.com <jmuc...@gmail.com> wrote:
>
> Just chiming in to note that an explainer like this would be lovely to have in docs somewhere, if it isn't already.
>
> On Saturday, 17 April 2021 at 15:31:04 UTC-4 bruno...@gmail.com wrote:
>>
>> The distance from the TrX, TrY, TrZ = 0,0,0 position to the canvas
>> plane is always 1. So if you lock the position of one of the photos
>> to 0,0,0, you can ask the Hugin optimiser to try and find a position
>> for the other photo that agrees with the control points in the
>> project.
>>
>> In the Photos tab you need to select 'custom parameters', and
>> optimise TrX and TrZ of the second photo (assuming that you have set
>> the yaw for this to 48.9 and don't need to optimise it). If this
>> results in a value for TrX of 0.1, given that this equates to 3.6"
>> in real world units, then the distance from the first photo to the
>> canvas plane is 3.6/0.1 = 36".
>>
>> Keep asking if this isn't working for you, this is a legitimate task
>> for Hugin, but it isn't easy conceptually, it would be nice to have
>> a good explanation, diagram or even some code that makes it easier.

jmuc...@gmail.com

unread,
Apr 28, 2021, 1:37:16 PM4/28/21
to hugin and other free panoramic software
I think you are being modest. Is there a better explanation somewhere?
Reply all
Reply to author
Forward
0 new messages