Attempting to Stitch 46 photos from DJI Spark 360 Pano

960 views
Skip to first unread message

Bryan Sarber

unread,
Jan 31, 2019, 1:32:56 AM1/31/19
to hugin and other free panoramic software
New here and to Hugin.  I have two panoramas I took with DJI Spark Drone while on vacation last summer.  I've not been able to stitch them using the tool I normally use - Microsoft ICE.  Thus far, I've not been able to stitch with Hugin, but admit I have a lot to learn.  These 2 panos were taken over water, but it seems there should be enough contrast to find alignment points.

The photos are here

I'd be grateful for any advice to get these stitched to the point I can decide how to render.  In the meantime, I'll start to dig into the documentation and tutorials to learn how to better use Hugin.  Looks to be much more feature rich than ICE.  What's best place to start learning?  

I would assume the drone follows a set path to create the 46 photos.  Is it possible to specify a 'recipe' of sorts that would make it easier, possibly faster for Hugin to do the alignment?

thank you!  -Bryan

Bryan Sarber

unread,
Jan 31, 2019, 7:35:28 PM1/31/19
to hugin and other free panoramic software
So I found some limited success with AutoStitch.  It at least stitched all the photos, but some misalignments and lots of ghosting.  Any advice appreciated!

pano.jpg

Geoffrey Liu

unread,
Feb 1, 2019, 1:30:53 AM2/1/19
to hugi...@googlegroups.com
>  Is it possible to specify a 'recipe' of sorts that would make it easier, possibly faster for Hugin to do the alignment? 

One approach I use is to specify the position of the photos, before you create a single control point.

To do this, you'll either need to be in the Advanced or Expert interface (Menu, Interface, Advanced). Sounds daunting, but it really gives you the control you need.

You should see a screen like this. Make sure you are on the photos tab.

image.png

Note that this screenshot is from a personal project so your results may vary.

In the Display control at right, check the radio box for Positions. Here you can modify the positions of each frame of your panorama. You specify the position of a frame by double clicking it in the Photos table, and setting its Yaw Pitch Roll. Translation parameters should all be at 0. Being a drone operator you should have a good concept of yaw pitch roll, if not, here is a reference --> https://en.wikipedia.org/wiki/Aircraft_principal_axes.

Your lens parameters should be set automatically if your image metadata supplies them; otherwise you will need to fill that out for all the images. Hint: you can selet multiple images and edit parameters that way.

Very pro tip:
If you have many images and want to write a script to specify the image positions, right click in the Photos table -> Manipulate image variables... here, you can type Perl (i think) code to batch-edit the image positions. Hint: The script you write is placed in a for loop that iterates from your 0th image to your Nth image, where N is the number of images you have. You'll want to use i as a variable in the script for the current image number. If this means nothing to you don't worry about it, you can still use my method described above, modifying each image's position one by one.

</end pro tip>

Specifying positions will help Hugin determine which sets of images i, j overlap, and then create control points between those images. This should increase the number, and the overall accuracy, of the CP's generated automatically e.g. using cp find.

I know this might be a lot to digest, let me know if anything is unclear. Hope this helps.

-- Geoff


--
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+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hugin-ptx/fd6f84cf-af72-400c-a972-35655732f8b2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

T. Modes

unread,
Feb 3, 2019, 10:22:03 AM2/3/19
to hugin and other free panoramic software


Am Freitag, 1. Februar 2019 01:35:28 UTC+1 schrieb Bryan Sarber:
So I found some limited success with AutoStitch.  It at least stitched all the photos, but some misalignments and lots of ghosting.  Any advice appreciated!

This misses all of the nadir images. This can be easily achieved by Hugin. Run cpfind. Then remove all images with no control points (go to panorama editor and select all images with 0 in column "# Ctrl Pnts" and select remove images from context menu (or press delete key). Then run assistant again (align images).

If you need the nadir images, this requires some more work.The problem with the nadir images is that they contain nearly no contrasting details.
So solve this use another location to shoot a pano with more contrast in the nadir (e.g. over land).
Then use this as template:
1. Either in Hugin;: File>Apply template
2. or on the command line pto_template --output=pano.pto --template=template.pto pano.pto

Or more advance is to read the position with are stored in the makernote and use them:
exiftool -p "y${Filename;s/DJI_//;s/\..*$//;$_-=1;}=$CameraYaw,p${Filename;s/DJI_//;s/\..*$//;$_-=1;}=$CameraPitch,r${Filename;s/DJI_//;s/\..*$//;$_-=1;}=$CameraRoll" -ext jpg . >pos.txt
pto_var --set-from-file=pos.txt --output=pano.pto pano.pto

After applying the template or reading the positions from the file, use
cpfind --prealigned --output=pano.pto
geocpset --output=pano.pto pano.pto

to generate control points and finally connect all orphaned images (images without structure) with the remaining images.

Then proceed with "normal" alignment or run assistant again.

T. Modes

unread,
Feb 10, 2019, 7:15:43 AM2/10/19
to hugin and other free panoramic software


Am Sonntag, 3. Februar 2019 16:22:03 UTC+1 schrieb T. Modes:


Am Freitag, 1. Februar 2019 01:35:28 UTC+1 schrieb Bryan Sarber:
So I found some limited success with AutoStitch.  It at least stitched all the photos, but some misalignments and lots of ghosting.  Any advice appreciated!

This misses all of the nadir images. This can be easily achieved by Hugin. Run cpfind. Then remove all images with no control points (go to panorama editor and select all images with 0 in column "# Ctrl Pnts" and select remove images from context menu (or press delete key). Then run assistant again (align images).

If you need the nadir images, this requires some more work.The problem with the nadir images is that they contain nearly no contrasting details.
This can be now solved with a user-defined assistant and using Hugin 2019.0 beta 2 (or later, beta 1 is not sufficient).
Download the attached file dji.assistant. Save the file in c:\users\USERNAME\AppName\Roaming\hugin (when using Windows, replace USERNAME with your username) or
~/.hugindata (for Unix). When you start now Hugin you will find in the panorama editor, menu Edit>User defined assistant a Assistant for DJI Drone. This one does the pre-alignment based on the information in the image EXIF data and runs then an adapted assistant sequence.

dji.assistant

Francis Trautmann

unread,
Sep 19, 2021, 11:06:46 AM9/19/21
to hugin and other free panoramic software
@T.Modes Many thank's for dji.assistant

With Hugin 2020.0.0.2f576e5d5b4a build by Thomas under windows 10 dji.assistant work fine, but Hugin 2020.0.0.2f576e5d5b4a under ubuntu 20.04 display error :

"The assistant did no complete successfully. Please check the resulting project file. Ok"

But i dont know where see the problem.

Perhaps it's exiftool under linux the problem
When i try exittols command
exiftool -p "y${Filename;s/DJI_//;s/\..*$//;$_-=1;}=$CameraYaw,p${Filename;s/DJI_//;s/\..*$//;$_-=1;}=$CameraPitch,r${Filename;s/DJI_//;s/\..*$//;$_-=1;}=$CameraRoll" -ext jpg . >pos.txt

I obtain this error
bash: y${Filename;s/DJI_//;s/\..*$//;$_-=1;}=$CameraYaw,p${Filename;s/DJI_//;s/\..*$//;$_-=1;}=$CameraPitch,r${Filename;s/DJI_//;s/\..*$//;$_-=1;}=$CameraRoll : Bad substitution

My version exiftool installed is 11.88 perhaps it's to old

For people have drone DJI mini air 2, i work on a small workflow to publish panorama on a simple php server (just php + sqlite needed) detail project here https://github.com/fran6t/ExhibMyDrone help or contribution are welcome.  

T. Modes

unread,
Sep 19, 2021, 12:12:16 PM9/19/21
to hugin and other free panoramic software
francis....@gmail.com schrieb am Sonntag, 19. September 2021 um 17:06:46 UTC+2:
When i try exittols command
exiftool -p "y${Filename;s/DJI_//;s/\..*$//;$_-=1;}=$CameraYaw,p${Filename;s/DJI_//;s/\..*$//;$_-=1;}=$CameraPitch,r${Filename;s/DJI_//;s/\..*$//;$_-=1;}=$CameraRoll" -ext jpg . >pos.txt

I obtain this error
bash: y${Filename;s/DJI_//;s/\..*$//;$_-=1;}=$CameraYaw,p${Filename;s/DJI_//;s/\..*$//;$_-=1;}=$CameraPitch,r${Filename;s/DJI_//;s/\..*$//;$_-=1;}=$CameraRoll : Bad substitution

My version exiftool installed is 11.88 perhaps it's to old

On Linux you need to swap double quotes with single quotes. So try
exiftool -p 'y${Filename;s/DJI_//;s/\..*$//;$_-=1;}=$CameraYaw,p${Filename;s/DJI_//;s/\..*$//;$_-=1;}=$CameraPitch,r${Filename;s/DJI_//;s/\..*$//;$_-=1;}=$CameraRoll' -ext jpg . >pos.txt

If this works, then modify the assistant file in the same way. The line should now read
Arguments=-p 'y$FileSequence=$CameraYaw,p$FileSequence=$CameraPitch,r$FileSequence=$CameraRoll' -w+! %0fpos.txt -@ %imagelist%

Thomas

Francis Trautmann

unread,
Sep 20, 2021, 5:56:40 AM9/20/21
to hugin and other free panoramic software
@T.Modes manythank's again
Command exiftools wih swap double quotes work fine, i must apdate a lot because with DJI Mavic mini air 2 CameraYaw is GimbalYawDegree...
This work fine with DJI Mavic mini air 2
exiftool -p 'y${Filename;s/DJI_//;s/\..*$//;$_-=1;}=$GimbalYawDegree,p${Filename;s/DJI_//;s/\..*$//;$_-=1;}=$GimbalPitchDegree,r${Filename;s/DJI_//;s/\..*$//;$_-=1;}=$GimbalRollDegree' -ext jpg . >pos.txt

DJI.assistant don't work i have update like this
Arguments=-p 'y$FileSequence=$GimbalYawDegree,p$FileSequence=$GimbalPitchDegree,r$FileSequence=$GimbalRollDegree' -w+! %0fpos.txt -@ %imagelist%.

I have same error describe before
"The assistant did no complete successfully. Please check the resulting project file. Ok"
View clipboard content is
Reading positions
Error opening arg file /home/fran6t/hiUTeeBn.

I have a problem on my config i think it's not a hugin problem, i have  file right problem because i use flatpak version

If i remove step 0 from DJI.assistant
I create pos.txt with command exiftool
I adjust preference temporay file with /home/fran6t/Bureau/Tordre-Assistant     (path were .jpg and pos.txt are)
I run DJI.assitant
The 6 step executed correctly

T. Modes

unread,
Sep 20, 2021, 2:09:11 PM9/20/21
to hugin and other free panoramic software
francis....@gmail.com schrieb am Montag, 20. September 2021 um 11:56:40 UTC+2:
DJI.assistant don't work i have update like this
Arguments=-p 'y$FileSequence=$GimbalYawDegree,p$FileSequence=$GimbalPitchDegree,r$FileSequence=$GimbalRollDegree' -w+! %0fpos.txt -@ %imagelist%.
There is a trailing period after %imagelist%. (This was an error in my initial assistant file.)
Remove the final period.
So the line should be
Arguments=-p 'y$FileSequence=$GimbalYawDegree,p$FileSequence=$GimbalPitchDegree,r$FileSequence=$GimbalRollDegree' -w+! %0fpos.txt -@ %imagelist%

Thomas

Francis Trautmann

unread,
Sep 26, 2021, 11:23:15 AM9/26/21
to hugin and other free panoramic software
@T. Modes Sorry Thomas for responding so late, I wanted to be able to share a little tutorial in my response.
Really thank you again for this help which allows me in my project to be able to put points of interest pointing towards the original images of construction of the sphere.
Without dji.assistant the automatic assembly is not always the same which prevented the correct functioning of the positioning of the points of interest.

Best regard
Francis
Reply all
Reply to author
Forward
0 new messages