pycitydata.streetview.equirectangular

Module Contents

Classes

Equirectangular

用于将等距柱状全景图分割成普通透视图

Data

API

pycitydata.streetview.equirectangular.__all__

[‘Equirectangular’]

class pycitydata.streetview.equirectangular.Equirectangular(sv: Union[pycitydata.streetview.baidu.BaiduStreetView, pycitydata.streetview.google.GoogleStreetView])

用于将等距柱状全景图分割成普通透视图

python tool to split equirectangular panorama into normal perspective view.

修改自(Modified From):https://github.com/fuenwang/Equirec2Perspec/tree/master

MIT License

Copyright (c) 2021 Fu-En Wang

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Initialization

static pil2cv(img: PIL.Image.Image)

PIL.Image.Image -> OpenCV

static cv2pil(img: numpy.ndarray)

OpenCV -> PIL.Image.Image

static _xyz2lonlat(xyz)
static _lonlat2XY(lonlat, shape)
get_perspective(fov: float, heading: float, pitch: float, height: float, width: float)

全景图透视投影 Equirectangular to Perspective

Args:

  • fov: 视野(单位:度)。Field of View (unit: degree)

  • heading: 水平方向朝向角(单位:度),范围为[0, 360],正东方向为0度,逆时针旋转。Horizontal direction angle (unit: degree), range is [0, 360], 0 degrees is east, counterclockwise rotation.

  • pitch: 俯仰角(单位:度),范围为[-90, 90],0度为水平方向,90度为垂直向上,-90度为垂直向下。Pitch angle (unit: degree), range is [-90, 90], 0 degrees is the horizontal direction, 90 degrees is vertical up, and -90 degrees is vertical down.

  • height: 输出图像高度。Output image height.

  • width: 输出图像宽度。Output image width.