/camera

Encapsulation of typical camera functionality.

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

Camera

Encaspulation of typical camera functionality.

Install

Dependencies

Install the following dependencies from the source, where the installation guide is provided in their respective repository.

Install

git clone https://github.com/ivapylibs/camera.git
pip3 install -e camera/

Note:

  1. testing/d435_tabletop_plane.py dependency only available on Python 3.7.

    This testing file uses a 3d visualization package pptk that is only available for the python 3.7, which is for helping some undergrads understand the algorithm in a course. If you use the python 3.7 environment and want to run this file, please install the dependency first:

    pip install pptk

    The test file visualize the extracted tabletop plane point cloud in the camera frame, which is a necessary step for the height estimation. You can skip that testing file and run the testing/d435_height.py directly.

    Or you can install the python 3.7 following the setups below and then install the pptk to run the plane visualization.

Ubuntu Python Environment Setup

The suggested python version is python 3.7, because one of the package (pptk) used in the test script is only supported by the python 3.7. The remaining will use the python 3.7 as an example. Any other version is similar.

  1. Install the Python 3.7

    sudo apt update
    sudo apt install software-properties-common
    sudo add-apt-repository ppa:deadsnakes/ppa
    sudo apt update
    sudo apt install python3.7

    Verify the installation:

    python3.7
  2. Install the Pip 3.7. The command line installation often cause errors, so use the installation script

    cd
    curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py"
    python3.7 get-pip.py
    # should enter the python3.7 environment
    # Ctrl-D to exit

    Verify the installation:

    pip3.7 -V
    # should see something like below
    # pip xx.x.x from /default/site-packages/path
  3. Change the default python3 version pip3 version (optional)

    Up until now every thing you run should be in the form of below (include the commands in the install section above). Because if your system have multiple python versions, the python3 or pip3 command might not be linked to the one you want.

    pip3.7 install SOMEPACKAGE
    python3.7 SOMESCRIPT.py

    We can optionally create the symlink pip3 and python3 for our desired version so that you can use the following command instead:

    pip3 install SOMEPACKAGE
    python3 SOMESCRIPT.py

    One way to do it is to use the update-alternatives command (change the python version in the first two lines accordingly, and similar for the pip) :

    sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.5 1
    sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.7 2
    
    sudo update-alternatives --config python
    
    sudo update-alternatives  --set python /usr/bin/python3.7

    Alternatively, we can create an virtual environment using the venv or the Anaconda for the desired python version to avoid the this step.