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.3.tar.gz (199.2 kB view details)

Uploaded Source

Built Distribution

virtual_camera-0.0.3-py3-none-any.whl (198.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: virtual_camera-0.0.3.tar.gz
  • Upload date:
  • Size: 199.2 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.3.tar.gz
Algorithm Hash digest
SHA256 f4b95b0597cd2b19c0f7368ef0ebcabdd339a82439a4af4c328eb33b2167073a
MD5 6370c12725dd2254f3767f269ec811e6
BLAKE2b-256 bfa544841b742ea0a0b994d84a6ca6b7ed534be74ab6b2644add22b1ccc193b5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for virtual_camera-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5efe54b5cefa602d4d7c999a9c40fafc5a0905010f86744d13b9ee7897b53688
MD5 942a90537b1f0783b659f07759acb069
BLAKE2b-256 7594041815a9787ec571f9208b380e0cd59dc11a3b289d8dab4d371faca48a96

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