{ "metadata": { "name": "", "signature": "sha256:781dc0e21998415296c246c626cef7bcc0924a87ef9bdfbb2154595571ccce47" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "3D Rotation of a Point Cloud" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import numpy as np\n", "import matplotlib.pyplot as plt\n", "from mpl_toolkits.mplot3d import Axes3D\n", "from IPython.html.widgets import interact\n", "from IPython.html import widgets\n", "import pandas as pd" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 200 }, { "cell_type": "code", "collapsed": false, "input": [ "%matplotlib inline\n", "np.set_printoptions(suppress=True, precision=3) # to avoid 1e-17 expressions in rotation matrix" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 201 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "Read Point Cloud Library File" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Following Scene was generated with [BlenSor](http://www.blensor.org/) and a [Point Cloud Library](http://pointclouds.org/) File (*.pcd) was exported.\n", "\n", "![Scene](Pointcloud00002.png)" ] }, { "cell_type": "code", "collapsed": false, "input": [ "pc = pd.read_csv('Pointcloud00002.pcd', names=['x','y','z','rgb'], skiprows=11, sep=' ')\n", "pc=pc[['x','y','z']]\n", "pc.head(3)" ], "language": "python", "metadata": {}, "outputs": [ { "html": [ "
\n", " | x | \n", "y | \n", "z | \n", "
---|---|---|---|
0 | \n", "14.718567 | \n", "1.070656 | \n", "-12.857123 | \n", "
1 | \n", "13.841802 | \n", "0.494996 | \n", "-11.860050 | \n", "
2 | \n", "12.500180 | \n", "-0.431674 | \n", "-10.255011 | \n", "