"Align..." command line equivalent

Asked by AL


what would be the exact equivalent of importing a single image in Hugin and clicking the "2.0 Align..." button ?
To be more precise, I'm trying to automate the steps found on this page (https://digital-photography-school.com/ways-to-correct-perspective-in-photography/) to correct perspective on a single photo.
I've combined this with https://wiki.panotools.org/Panorama_scripting_in_a_nutshell to try to make all this in command line, but I can't find the exact chaining or arguments to get the exact same result that I get by simply loading an image and clicking "align" in Hugin.

For the moments, here are the command I use :

pto_gen.exe -p 0 --distortion --vignetting -o test.pto test.JPG
cpfind.exe -o test.pto --multirow --celeste test.pto
cpclean.exe -o test.pto test.pto
linefind.exe -o test.pto test.pto
autooptimiser.exe -a -s -m -l -o test.pto test.pto
pano_modify.exe -o test.pto --ldr-file=JPG --ldr-compression=90 --canvas=AUTO --crop=AUTO test.pto
hugin_executor.exe --stitching --prefix=out_ test.pto

I have a result, but very distorted compared to the perfect result I get in one click in Hugin.

Thanks for your help !

Question information

English Edit question
Hugin Edit question
No assignee Edit question
Solved by:
Last query:
Last reply:
Revision history for this message
Best tmodes (tmodes) said :

For a single image the assistant has a specialized command sequence, slightly different from the one described in the scripting page.

If you want to run the same sequence as the assistant, the easiest way would be to use hugin_executor --assistant.
So on the command line it would be like
pto_gen -o test.pto test.jpg
hugin_executor --assistant test.pto
hugin_executor --stitching --prefix=out_ test.pto

Revision history for this message
AL (thewild) said :

Thanks tmodes, that solved my question.

Revision history for this message
AL (thewild) said :

Thanks a lot !
Much easier and perfect result !

I just need to understand what I need to change in order to have jpg output, but I think I can handle that.
Thanks again !

Revision history for this message
AL (thewild) said :

pano_modify -o test.pto --ldr-file=JPG --ldr-compression=90
That's it !
Very powerfull.