Coder Social home page Coder Social logo

astoeckel / cylinder_world Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 0.0 453 KB

Python one-dimensional omnidirectional panorama renderer for a toy "cylinder world"

License: GNU General Public License v3.0

Python 3.46% Jupyter Notebook 96.54%
python toy-dataset

cylinder_world's Introduction

Cylinder World Renderer

Visualisation of the "cylinder world"

Renders one-dimensional panoramic images in a toy "cylinder world". An agent is located on the plane in an environment consisting of a randomly textured cylinder. The agent measures the light intensity of its surroundings in a 360° range, resulting in a one-dimensional panoramic image.

This code is mostly meant to generate toy-datasets for machine learning experiments.

Features

  • Analytic anti-aliasing
    The random cylinder texture is automatically filtered to avoid aliasing artefacts.
  • Analytic gradient
    Can compute the image-space gradient. This is useful when testing optical flow algorithms.
  • Depth
    Can compute a ground-truth depth-map.

How to use

import numpy as np
from cylinder_world import CylinderWorld

world = CylinderWorld(
	resolution=256,    # Number of pixels to render
	n_coeffs=32,       # Number of Fourier coefficients for the texture
	radius=2,          # Radius of the cylinder
	rng=np.random)

# Render the view at location (0.5, -0.4) with orientation np.pi / 2.
# Note all points must be located within the cylinder. The x-, y-, and theta-
# coordinates can be an array to render the view at multiple locations.
world.render(0.5, -0.4, np.pi / 2)

Installation and Testing

This package depends on numpy. Simply install this package using pip.

git clone https://github.com/astoeckel/cylinder_world
cd cylinder_world
pip install -e .

For unit-tests, install pytest and simply run pytest from the repository root directory.

License

Cylinder World Renderer
Copyright (C) 2021 Andreas Stöckel

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.