On Tue, May 14, 2024 at 12:58:52PM +0000, 'ChameleonScales' via hugin and other free panoramic software wrote: > Thank you. That answered part of my question. I'm still wondering how > it determines the orientation of the panorama though. > > Let's say I take photos with a panoramic head at random y,p,r > orientations (so there can even be photos taken in portrait format, > others in landscape and all the in-between angles). If I stitch them > in Hugin and then click on "Straighten", will it determine a > "dominant" orientation so that the equator of the panosphere is > closest to as many photo centers as possible or will it do something > else ? > > I may do some tests to understand it better.
I did a quick stare at the source code (namely hugin_base/algorithms/basic/StraightenPanorama.cpp), and from what I can tell, it does the following. All the images in a panorama are iterated over and an "up" vector for each image is produced based on the local coordinate system of the image. The "up" vector of each image is processed into a covariance matrix so that an average / composite "up" vector for the entire panorama can be calculated. A rotation is then calculated to rotate the entire panosphere so that its "up" matches this composite "up" of all the images. In short, it figures out the way to rotate the whole panorama (without moving any individual images with respect to each other) such that all of the individual images are as level as possible. Note that there are a bunch of caveats mentioned in the code. It attempts to detect portrait-rotated images based on exif data, so if that is not present / correct, it will not work. If any image translation variables are in use, they will not be accounted for and the straighten will likely fail. Since it does not move individual images, just the whole pano, straighten works best on panos that have a good geometric optimization. And finally, there is the baked-in assumption that leveling the individual images will actually level the panorama. If the input images were not shot level with respect to the horizon, then straighten will not help. --Sean -- 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/hugin-ptx/ZkOYCEtSsAI1Xjfb%40glitch.