Hello!

Just in case someone comes across this thread, I have figured out the 
solution suggested above that is currently working….templates and 
prealigned commands to re-use known locations of images. The DJI Mini 2 
shoots a pano in the same manner each time thankfully. 

I have modified my script that stitches my DJI Mini 2 Pano photo sets and 
it does the following -

Here is what my script does - 

   1. Generates a new PTO for the specific folder 
   2. import template details. 
   3. cpfind (with pre-aligned as the drone uses the same pattern each time) 
   4. clean control points 
   5. geocpset to “match” images without CP’s…this was needed for areas of 
   water/snow that are mostly featureless. 
   6. clean control points 
   7. linefind (not really seeing a benefit to this one, but that is 
   another story) 
   8. Autooptimiser 
   9. Pano_Modify - tweak the settings to get the output I want. 
   10. send the PTO to batch processor to not completely kill my computer 
   when doing large sets. 

The trick with the featureless images (water this time, but I think it will 
be similar with my snow photos) was the creation of a template and using 
the pre-aligned parameter along with the geocpset tool. 

This is not perfect yet, but far better. 

Note - Templates - I used a pto file that was very close to perfect for my 
template.pto. The script ingests this template file and uses the needed 
data for positioning. I could not find a good reference for the —prealigned 
parameters/process, so this was a lot of trial and error. 

The full script as of writing this -
REM 2023-08-21- This script is being built to take a folder full of folders 
containing groups of .jpg photos from the drone 360 photo tool and export a 
2:1 aspect ration photo to be uploaded to google Maps/Streetview. REM Guide 
followed located here - 
https://wiki.panotools.org/Panorama_scripting_in_a_nutshell#Creating_hugin_projects_on_the_command-line
 
REM - dji.assistant file uses a similar process, but dynamically pulls 
data. If the template I have setup does not work well, this may be a new 
idead - http://www.wse.fr/How-TO/dji-30.assistant REM Hugin needs to be 
installed here C:\Program Files\Hugin REM - This script is being called by 
the deployment script. The Deployment script copies this to each folder in 
the specified directory and then executes it. All sub-folder tasks will run 
at the same time, so it will take a bit of time when doing many panos. REM 
- MAKE SURE YOU DO NOT HAVE ANY NON-PANO IMAGES IN THE FOLDER. THE SOFTWARE 
TRIES TO EAT THEM AND ADD TO YOUR PANO. REM - set the name of the variable 
we will be using. This will be the name of the directory the file is in. 
@echo off for %%I in (.) do set "current_folder=%%~nxI" echo The current 
folder is: %current_folder% REM Build the PTO file with the contents of the 
directory we are currently in. "C:\Program Files\Hugin\bin\pto_gen" *.jpg 
-o %current_folder%.pto REM Add detail from the template example (a good 
DJI Mini2 pano in my case) to new PTO file from the template of a known 
good file. REM - 
https://groups.google.com/g/hugin-ptx/c/Af7TG2Bq-ko/m/3g3y-xIoEAAJ 
"C:\Program Files\Hugin\bin\pto_template" --o %current_folder%.pto 
--template=template.pto %current_folder%.pto REM Create Control Points in 
the project "C:\Program Files\Hugin\bin\cpfind" --prealigned -o 
%current_folder%.pto %current_folder%.pto REM Clean up the control points 
"C:\Program Files\Hugin\bin\cpclean" -o %current_folder%.pto 
%current_folder%.pto REM Use the non-conntected tool to align non-CPlinked 
images REM - 
https://groups.google.com/g/hugin-ptx/c/Af7TG2Bq-ko/m/3g3y-xIoEAAJ 
"C:\Program Files\Hugin\bin\geocpset" -o %current_folder%.pto 
%current_folder%.pto REM Clean up the control points "C:\Program 
Files\Hugin\bin\cpclean" -o %current_folder%.pto %current_folder%.pto REM 
Find Vertical Lines "C:\Program Files\Hugin\bin\linefind" -o 
%current_folder%.pto %current_folder%.pto REM Optimize "C:\Program 
Files\Hugin\bin\autooptimiser" -a -l -s -m -o %current_folder%.pto 
%current_folder%.pto REM set output/stitcher options REM These options are 
to setup the pano for upload to Google Maps. "C:\Program 
Files\Hugin\bin\pano_modify" -o %current_folder%.pto --fov=360x180 --center 
--straighten --canvas=9000x4500 --ldr-file=JPG --ldr-compression=100 
--output-exposure=AUTO %current_folder%.pto REM Stitch the output - un-rem 
the next line if you want the script to stitch right away. I had too many 
at once so I moved over to the batch tool, which is the command below. REM 
"C:\Program Files\Hugin\bin\hugin_executor" --stitching 
--prefix=%current_folder% %current_folder%.pto REM send to batch to run 
sequentially. REM Only use the next line if the "hugin_executer" line is 
commented out. "C:\Program Files\Hugin\bin\PTBatcherGui.exe" --batch 
%current_folder%.pto REM - Figure out how to get rid of the black blocks at 
the top. 
​
On Thursday, February 16, 2023 at 10:09:09 AM UTC-6 Jan Steinman wrote:

> "*you don't need to find the control points each time. Just use one set 
> of images for finding control point and alignment*"
>
> I agree. What I have done when stitching 60° segments of spheres is to 
> manually place a *single* control point in the top centre of each 
> horizontal image, then place six corresponding control points every 60° in 
> the zenith shot.
>
> Since your sky is so uniform, I think you could easily do a similar 
> approach for the sky, leaving hugin to choose the points it can. That may 
> result in some odd "stretching" of the sky relative to the other points, 
> but I bet no one will ever notice.
>

-- 
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/bbfd7e28-b8c6-4f20-9421-4e49c06055c0n%40googlegroups.com.

Reply via email to