There is a tool in the Panotools::Script Perl module called `nona-deshake` that does most of this, see this thread: https://groups.google.com/g/hugin-ptx/c/yFE6VF-mtGk/m/CCErzyeGDwAJ
You basically create a Hugin project with a single photo, straighten, crop, change projection, whatever. Then this is used as an anchor to align all the other photos in the sequence. I planned on extending it to support multiple photos in this anchor project (so you could represent all different lighting conditions) but this hasn't happened yet. There has been at least one attempt to create a python equivalent of Panotools::Script, I don't have any links :( -- Bruno On 16 May 2021 04:53:37 BST, spmp wrote: > >I have a camera taking images every two minutes of an outdoor scene. The >mount moves enough that the images need aligning. I am in the process of >creating scripts to align and remap a days worth of images at a time (once >a day) against a chosen anchor image and am looking for advice on how best >to proceed. > >What I have done and am aiming to do: >Found the lens parameters. The FOV is 98deg, so required for CPFind as it >remaps. > >I have a script which finds all images at midday, then I have created >control points pairwise on all pairs to find the most suitable image to use >as an anchor. The image with the lowest contrast (i.e overcast) matched > >with all other days so far and with the lowest total distance (I wish you >could export the control point matrix to CSV!) > >I have found that as the scene has street lights in at morning and evening >that I can create control points between sequential pairs for a single day >reliably without disjoint groups. Finding control points between days is >highly problematic due to varying light and weather. > >My idea is to in a scriptwise fashion: > >1. Create a PTO file for a days worth of images with includes just the >images, lens parameters and exclusion mask (mask out trees, sky, etc) >based > on a PTO file saved from Hugin. >2. Find the image closest to midday and insert the anchor image into the > PTO file after it, making it the anchor for position. >3. Run CPFind using 'linearmatch', 'fullscale', and caching. Your input > > on good parameters here is highly appreciated! >4. Optimise the positions - Which parameters should I include and not... > At this stage thinking y,p,r,TrX,TrY,TrZ. > 5. Caclulate the field of view, crop, and output size etc. I have no >idea how to do this so all images will align perfectly from day to day. I >am assuming that the use of an anchor image will tie them all together. > 6. Remap all images except the anchor (or with the anchor it doesn't > matter) > > > - Is this the best way to do this? What other options do I have if I > want to do it day at a time? >- Is there a tool for manipulating PTO files, such as removing an image > > etc? > - Are there Python bindings for hugin-tools? > - As in the notes above, how can I ensure consistent remapping day to day? >- How can I 'straighten' the anchor image? If I just included this and >straightened using the GL viewer or similar, what parameters in the PTO > > file reflect this please? > >I think you get the idea 8) I am hoping that there is a tool that does this >already, but if not and this is the way to go I am looking forward to the >challenge of it 8) > >Cheers -- 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/AAF98EB2-6DF4-4CAE-B656-2C5B4D30C6B8%40postle.net.