Skip to content

Instantly share code, notes, and snippets.

@compustar
Last active June 16, 2021 12:49
Show Gist options
  • Save compustar/c7350b5a6a169394f0b3e57475289d8a to your computer and use it in GitHub Desktop.
Save compustar/c7350b5a6a169394f0b3e57475289d8a to your computer and use it in GitHub Desktop.
Batch files for Hugin stitching for Mi Sphere or Madv360 with template (https://github.com/pxlartificer/XiaomiMijiaMi-HuginTemplate).
REM Usage: hugin_stitch.bat template-XiaomiMijiaMiJPG.pto IMG_20171231_172305.jpg
@echo off
SET PATH=%PATH%;C:\Program Files\Hugin\bin
FOR %%i IN ("%2") DO (
SET Name=%%~ni
)
pto_gen %2 %2 --output=%Name%_stitched.pto
pto_template --output=%Name%_stitched.pto --template=%1 %Name%_stitched.pto
hugin_executor --stitching --prefix=%Name%_stitched %Name%_stitched.pto
REM Put photos, template-XiaomiMijiaMiJPG.pto, and the batch file in the same directory
REM
REM Usage: hugin_stitch.bat template-XiaomiMijiaMiJPG.pto
@echo off
SET PATH=%PATH%;C:\Program Files\Hugin\bin
FOR %%G IN (*) DO (
pto_gen %%G %%G --output=%%~nG_stitched.pto
pto_template --output=%%~nG_stitched.pto --template=%1 %%~nG_stitched.pto
hugin_executor --stitching --prefix=%%~nG_stitched %%~nG_stitched.pto
)
REM Template path: C:\Hugin\tempmlates\template-XiaomiMijiaMiJPG.pto
REM Photos in c:\Madv360
REM
REM Usage: hugin_stitch.bat C:\Hugin\tempmlates\template-XiaomiMijiaMiJPG.pto c:\Madv360
@echo off
SET PATH=%PATH%;C:\Program Files\Hugin\bin
FOR %%G IN (%2\*) DO (
pto_gen %%G %%G --output=%%~nG_stitched.pto
pto_template --output=%%~nG_stitched.pto --template=%1 %%~nG_stitched.pto
hugin_executor --stitching --prefix=%%~nG_stitched %%~nG_stitched.pto
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment