How to calculate photo coordinates from it's position data ?

134 views
Skip to first unread message

Cyril Preiss

unread,
Jan 25, 2021, 10:53:59 AM1/25/21
to PTGui Support
Hi,

i had developped a python code running trough all my photos to check witch photo has the sharpest data for each part of the panorama using yaw, pitch and roll.
This code is then creating the png mask for each of this photos so that ptgui is using the best source among all the pics.

It's working fine with a single pan and tilt camera.

I now want to use a camera that is always facing the subject (a painting) to get better quality. This means that every picture has a different viewpoint.

Could you help me to figure out how to use the yaw, pitch and roll AND vpx,vpy, vpd,vppan et vptilt to calculate wich area of a picture corresponds to wich area of the stiched panorama ?
There must be a formula but i don't manage to find it out.

thanks,

Cyril 

Cyril Preiss

unread,
Jan 28, 2021, 2:49:13 AM1/28/21
to PTGui Support
Hi Joost, any help from you on this ?

PTGui Support

unread,
Jan 28, 2021, 3:55:58 AM1/28/21
to pt...@googlegroups.com
For viewpoint correction PTGui does a 3d rotation around the x axis for
vpTilt, followed by a rotation around the z axis for vpPan, followed by
this transform:

[x'] [exp(vp_z), 0, 0 ]
[y'] = [x y z] * [vp_x, 1, vp_y ]
[z'] [0, 0, exp(vp_z) ]

followed by the normal ypr transform.

Deriving the complete pixel transform is not trivial, that's not
something I can help with. Perhaps it's worth looking at hugin or pano12
source code. PTGui doesn't use this but the transformations are similar.

Kind regards,

Joost Nieuwenhuijse
www.ptgui.com
> --
> You received this message because you are subscribed to the Google
> Groups "PTGui Support" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to ptgui+un...@googlegroups.com
> <mailto:ptgui+un...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ptgui/2557ae18-2005-4dde-af93-54b3ba6fc056n%40googlegroups.com
> <https://groups.google.com/d/msgid/ptgui/2557ae18-2005-4dde-af93-54b3ba6fc056n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Cyril Preiss

unread,
Jan 28, 2021, 3:57:16 AM1/28/21
to PTGui Support
ok thanks
Reply all
Reply to author
Forward
0 new messages