Is the Panorama from the mobile SDK working?
1663 10 2020-9-11
Uploading and Loding Picture ...(0/1)
o(^-^)o
Leandro31
lvl.3
Flight distance : 455892 ft
Uruguay
Offline

  Hi there, I was wondering on how DJIGo makes the panorama images on the Mavic 2 Pro, it seems like the sdk do it all as the final image is in drone memory and not in the de phone so looks like all the process is done by the SDK. However on the DJI site the panorma example requerie to do it all manually from taking the picture to stiching it and all have to be  done in the app side. So how is the Mavic 2 is stiching the images in the drone memory? I have seen that there is a DJICameraShootPhotoModeCameraPanorama and the camera accept that mode without any problem but then there isn't any documentation on how it works, just taking a picture do not anything.

Thanks in advance for any help

2020-9-11
Use props
kv886
lvl.4

Hong Kong
Offline

It is just take pictures. You need to create Panorama yourself. Look at https://developer.dji.com/cn/doc ... -bbc1-3e1f39d4985c.  It introduced how to use OpenCV to Create Panorama
2020-9-15
Use props
DJI_Lisa
lvl.4
United States
Offline

There is a tutorial with examples of how to stitch the photos: https://developer.dji.com/docume ... 9-90e2-254d5a176db8
2020-9-15
Use props
jackwrangham
lvl.4
Flight distance : 917057 ft
  • >>>
United Kingdom
Offline

Hi, we are trying this too.

So there are many way to capture a panorama - the 'manual' version as per the links above, no worries this works. BUT, with DJI G 4 and Mavic 2, it is possible to get drone to take a panorama, where it automatically takes all photos needed AND stitches the images in-drone, the final result is saved the sd card.

Looking through the SDK documentation, we see DJICameraShootPhotoModeCameraPanorama

https://developer.dji.com/api-re ... ootphotomode_inline

This mode is stated as 'In Camera Panorama mode, which is miss in Previous Version since Mavic 2 Zoom and Mavic 2 Pro.' - which I think means it will do as DJI go 4 does above...

But when we try to use this mode, the drone takes a single photo only, so it does not seem to work....

Thanks
2020-9-16
Use props
DJI_Lisa
lvl.4
United States
Offline

I will talk to our developers about providing an iOS  sample code for this API but in the meanwhile,  how are you setting this up?  Which pano mode are you trying out?  enum DJICameraPhotoPanoramaMode
Currently there is no iOS sample but there is one in the Android Beta UX SDK for beta if you want to check out how it's set up there: https://github.com/dji-sdk/Mobil ... ramaPhotoState.java

2020-9-16
Use props
Leandro31
lvl.3
Flight distance : 455892 ft
Uruguay
Offline

DJI_Lisa Posted at 9-16 13:30
I will talk to our developers about providing an iOS  sample code for this API but in the meanwhile,  how are you setting this up?  Which pano mode are you trying out?  enum DJICameraPhotoPanoramaMode
Currently there is no iOS sample but there is one in the Android Beta UX SDK for beta if you want to check out how it's set up there: https://github.com/dji-sdk/Mobil ... ramaPhotoState.java

Hi Lisa

  Yes this is on iOS. I'm using the mode DJICameraShootPhotoModePanorama with the method setShootPhotoMode. I'm using it sending the drone to a specific point and call the method startShootPhoto then the callback result is success but there only one photo. There is a lack of info on how this method work so I'm not sure if this is the right approach.

    /**
     *  In panorama mode, the aircraft takes a series of photos with different gimbal
     *  and aircraft heading positions. The photos can be stitched with a third-party
     *  library. It is supported by Spark, Mavic Air, Mavic 2, Mavic 2 Pro, Mavic 2
     *  Zoom, Mavic 2 Eneterprise, Mavic 2 Enterprise Dual.
     */
    DJICameraShootPhotoModePanorama
2020-9-16
Use props
DJI_Lisa
lvl.4
United States
Offline

The link I shared earlier for  enum DJICameraPhotoPanoramaMode: https://developer.dji.com/api-re ... anoramamode_inline.  Which one of the below are you picking?
2020-9-21
Use props
jackwrangham
lvl.4
Flight distance : 917057 ft
  • >>>
United Kingdom
Offline

Looks like there is two lists, we have been looking at this one:


2020-9-22
Use props
DJI_Lisa
lvl.4
United States
Offline

Try using the other pano mode - the translation in the one you are using got mangled but I think it's trying to tell you it doesn't work for M2P and Zoom
2020-9-29
Use props
hdrpano
lvl.4
Flight distance : 598458 ft
  • >>>
Switzerland
Offline

It is not as simple as it seems... This is how it works.
After this init, just shoot a photo. When it is done reset the panorama mode. If you like to know more have a look on my own DJI Framework on GitHub. Most DJI SDK functions are implemented and easy to use.

    //MARK: Prepare Internal Panorama
    func shootPhotoPreparePanorama() {
        let cameraMode: DJICameraMode = .shootPhoto
        let shootMode: DJICameraShootPhotoMode = .panorama
        let panoMode: DJICameraPhotoPanoramaMode = .modeSphere
        var fileFormat: DJICameraPhotoFileFormat = .RAW
        var panoSettings: DJICameraOriginalPhotoSettings = DJICameraOriginalPhotoSettings.init(savingOriginalImagesEnabled: true, andFormat: .RAW)
      
        panoSettings = DJICameraOriginalPhotoSettings.init(savingOriginalImagesEnabled: true, andFormat: .RAW)
      
        let camera = ProductCommunicationManager.shared.fetchCamera()
        if camera != nil {
            camera?.setMode(cameraMode, withCompletion: { (error: Error?) in
                if error != nil {
                    print("Error set camera mode");
                }
            })
            camera?.setShootPhotoMode(shootMode, withCompletion: { (error: Error?) in
                if error != nil {
                    print("Error set camera shoot mode");
                }
            })
            camera?.setPhotoFileFormat(fileFormat, withCompletion: { (error: Error?) in
                if error != nil {
                    print("Error set file format");
                }
            })
            camera?.setPhotoPanoramaMode(panoMode, withCompletion: { (error: Error?) in
                if error != nil {
                    print("Error set panorama mode");
                }
            })
            camera?.setPanoOriginalPhotoSettings(panoSettings, withCompletion: { (error: Error?) in
                if error != nil {
                    print("Error set panorama settings");
                }
            })
        }
    }

    //MARK: Reset Intern Panorama
    func resetInternPanorama(){
        let cameraMode: DJICameraMode = .shootPhoto
        let shootMode: DJICameraShootPhotoMode = .single
        let camera = ProductCommunicationManager.shared.fetchCamera()
        if camera != nil {
            camera?.setMode(cameraMode, withCompletion: { (error: Error?) in
                if error != nil {
                    print("Error set camera mode");
                }
            })
            camera?.setShootPhotoMode(shootMode, withCompletion: { (error: Error?) in
                if error != nil {
                    print("Error set camera shoot mode");
                }
            })
        }
    }
2020-9-30
Use props
jackwrangham
lvl.4
Flight distance : 917057 ft
  • >>>
United Kingdom
Offline

hdrpano Posted at 9-30 09:05
It is not as simple as it seems... This is how it works.
After this init, just shoot a photo. When it is done reset the panorama mode. If you like to know more have a look on my own DJI Framework on GitHub. Most DJI SDK functions are implemented and easy to use.

Thanks!

Will this work with with the internal panorama stitching the mavic 2 can do? - do you have that working with the sdk in our app?
2020-10-6
Use props
Advanced
You need to log in before you can reply Login | Register now

Credit Rules