Hook to set panoData when image size is known? (or a "drone mode")
See original GitHub issueWhen dealing with 360 photo spheres generated by a Mavic 2 Pro drone there are 24-26 images being taken for stitching, but due to the limited upwards tilt of the camera on the drone these mostly cover 80% downwards and around, with the sky/straight up missing.
I’ve done stitching in various applications (Lightroom, ICE, etc) but when I load these into PSV the horizon is horribly warped, so I had to look into manually setting the crop information using panoData.
I know how to deal with this now as long as I know the image size in advance, doing something like this:
const url = 'PANO0001_stitch_rz.jpg';
const width = 16384; // known width
const height = 5757; // known height
let panoData = { // we know width will be 2x height
fullWidth: width,
fullHeight: width / 2,
croppedWidth: width,
croppedHeight: height,
croppedX: 0,
croppedY: (width / 2) - height
};
…and passing that on to the viewer constructor, but it would be good if there was a way of initializing the panoData dynamically, e.g. in the ready
event when the image size is known.
Is there a way of doing this today? I didn’t find anything in the documentation,
Or would it be possible to have some kind of “droneMode: true” configuration parameter where it automatically does this?
Example image: https://spoox.org/pano/PANO0001_stitch_rz.jpg (yes I know I forgot to crop the top…)
Example OK: https://spoox.org/pano/index.html Example warped (no crop data): https://spoox.org/pano/index-without.html
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (2 by maintainers)
Your are showing code of the wrong repository.
I’ll see what can be done
@sp00x if your server have php and gd library or equivalent you could make like this