Hi Michael, it has been quite a while since I have done anything this complex in pto_var ot pano_modify, so I hope somebody else can answer your detailed questions.
A couple of things I noticed: You are running cpclean immediately after running cpfind, but cpclean filters control points based on how well they optimise, so you should run it after optimisation, or at least after you have set all your optimisation parameters. Then usually you would run optimisation again after running cpclean. Although fixing barrel distortion in an external tool should be fine, you might want to let Hugin optimise vignetting if you are also optimising exposure, Hugin uses the exposure distribution caused by the vignetting to calculate the camera response curve. I don't think Hugin settings like mosaic drag mode are stored in the PTO file, in which case it wouldn't be possible to set this on the command-line. -- Bruno On Wed, 27 Apr 2022 at 19:30, 'Michael Perry' wrote: > I am converting my workflow to the command line. I have a problem with > pto_var and a question about pano_modify, I wonder if you can advise me. > > BACKGROUND > > I am stitching a mosaic of images of a painting. The photographs have been > shot with a camera mounted on a gimbal that is itself suspended on an X-Y > frame. The biggest difference between one image and the next is its X-Y > position. In theory they should all have the same pitch and yaw as the camera > moves little on its gimbal. There is some slight Z to account for as the > frame is not perfectly parallel to the painting. The images have to be > rotated some 90 degrees. > > The images have been pre-processed for lens distortion and vignetting with > Capture One, so I am ignoring lens parameters. > > COMMAND LINE > > I have been using the following commands to build the .pto file. I have > annotated them in case it is useful for other people > > pto_gen -p 0 -f 40.7 -o project.pto *.tif > > (create the project with all files in folder, rectilinear projection and a > 50mm lens (FOV = 40.7) > > cpfind --multirow --fullscale -o project_cp.pto project.pto > > (find control points in a mosaic, full-scale probably not necessary for me) > > cpclean -o project_clean.pto project_cp.pto > > (clean control points) > > pto_var --set=r=90 --opt=TrX,TrY -o project_XY.pto project_clean.pto > > (set X-Y variables of all images EXCEPT anchor, for optimisation) > > autooptimiser -n -o project_XY.pto project_XY.pto > > (optimise images for X and Y) > > pto_var --opt=y,p,TrZ -o project_ypZ.pto project_XY.pto > > (set pitch, yaw and Z of all images EXCEPT anchor) > > This is where I have the problem, I need to select the yaw and pitch of the > anchor image for optimisation with all the rest. I can not see how to do that > easily. > > POSSIBLE SOLUTION > > pto_var --opt=y0,p0,y1,p1,TrZ -o project_ypXYZ.pto project_ypZ.pto > > (set pitch, yaw and Z of all images INCLUDING anchor) > > It is possible to select the anchor if each image is individually selected. > HOWEVER when large mosaics are stitched it makes for clumsy code. > > EXTRA QUESTION > > pano_modify --projection=0 --fov=AUTO -o finished.pto project_ypXYZ.pto > > (Set projection to Rectilinear, fit image to screen) > > I finalise the image in Fast Panorama preview having set Projection to > Rectilinear and fitted the image to the screen. It would be helpful if I > could also set the Drag Mode to Mosaic in the Move/Drag tab and the Overview > Mode to Mosaic Plane. Is there some code that might effect this? > > Hoping you will find these interesting problems. -- Bruno -- 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/hugin-ptx/CAJV99Zj%2BCP-%2BGa7yTxFwk_eCMGZZ34CsDOH7Uf9PHgfmf5FzrA%40mail.gmail.com.
