Skip to main content

Virtual Camera

Project description

Virtual Camera

Install

pip install virtual_camera

Virtual Cameras

Following are defaultvVirtual camera setups.

VCAMERA_PERSPECTIVE_FRONT = create_virtual_perspective_camera((1280, 960), (-90, 0, 0), (0, 1.5, 1.5))
VCAMERA_PERSPECTIVE_FRONT_LEFT = create_virtual_perspective_camera((1280, 960), (-90, 0, 45), (-1, 2, 1))
VCAMERA_PERSPECTIVE_FRONT_RIGHT = create_virtual_perspective_camera((1280, 960), (-90, 0, -45), (1, 2, 1))
VCAMERA_PERSPECTIVE_BACK = create_virtual_perspective_camera((1280, 960), (-90, 0, 180), (0, -1, 1))
VCAMERA_PERSPECTIVE_BACK_LEFT = create_virtual_perspective_camera((1280, 960), (-90, 0, 135), (-1, 2, 1))
VCAMERA_PERSPECTIVE_BACK_RIGHT = create_virtual_perspective_camera((1280, 960), (-90, 0, -135), (1, 2, 1))

VCAMERA_FISHEYE_FRONT = create_virtual_fisheye_camera((1024, 640), (-120, 0, 0), (0, 3.5, 0.5))
VCAMERA_FISHEYE_LEFT = create_virtual_fisheye_camera((1024, 640), (-135, 0, 90), (-1, 2, 1))
VCAMERA_FISHEYE_RIGHT = create_virtual_fisheye_camera((1024, 640), (-135, 0, -90), (1, 2, 1))
VCAMERA_FISHEYE_BACK = create_virtual_fisheye_camera((1024, 640), (-120, 0, 180), (0, -1, 0.5))

Instructions

Convert from a real image.

import virtual_camera as vc

Initialize the a camera from a real image and its calibration file.

yaml_file = 'data/calibration.yml'
cfg = yaml.safe_load(open(yaml_file, 'r'))
camera_real = vc.FisheyeCamera.init_from_motovis_cfg(cfg)

Read the real image.

src_image = plt.imread('data/src_image.jpg')

src_image

Convert the image to a virtual image. Alongside with mask.

dst_image, mask = vc.render_image(src_image, camera_real, vc.VCAMERA_PERSPECTIVE_FRONT)

dst_image

mask

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

virtual_camera-0.0.4.tar.gz (199.4 kB view details)

Uploaded Source

Built Distribution

virtual_camera-0.0.4-py3-none-any.whl (198.4 kB view details)

Uploaded Python 3

File details

Details for the file virtual_camera-0.0.4.tar.gz.

File metadata

  • Download URL: virtual_camera-0.0.4.tar.gz
  • Upload date:
  • Size: 199.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.5

File hashes

Hashes for virtual_camera-0.0.4.tar.gz
Algorithm Hash digest
SHA256 b2aa01b27c36fa9725a450b94d14b4ede08c7d164012115267094b7d385b289e
MD5 a9bfe0e588ac7dae8369c01272059ec6
BLAKE2b-256 5bd61a88ad681ac3e8b4d8413ad2cb61567b65f23f8d2b04d5521668ac0eaff8

See more details on using hashes here.

File details

Details for the file virtual_camera-0.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for virtual_camera-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 f4c0d5bca21766bca65b4505851f67a4a7fa49bbbf91dfe10785e2d0f16b6468
MD5 1322b25c626794138076b579d984e1ef
BLAKE2b-256 952575d53dec73185955a8692a956c4627977f843529a4229492507265a596a1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page