Giter VIP home page Giter VIP logo

cvlab's Introduction

This repository contains code and resources for my personal computer vision lab. It will be a playground for new ideas using a diversity of (Python and C++) libraries, 2D and 3D input devices (such as webcams, Kinect, Leap Motion and Wiimotes), prototypes, and documentation.

As this repo is meant for experimentation and prototyping, please do not judge code quality ;)

Installation (Ubuntu)

Last tested on Ubuntu 20.04.

sudo apt-get install python3-pip python3-numpy python3-dev potrace libgtk2.0-dev libeigen3-dev libavcodec-dev libdc1394-22-dev libjpeg-dev libpng-dev libtiff-dev libopenni-dev imagemagick libffi-dev libhdf5-dev libhdf5-serial-dev libatlas-base-dev

python3 -m venv venv
source venv/bin/activate
pip install -r requirements/desktop.txt  # or requirements/pi.txt on raspberry pi

Raspberry Pi

Additionally, on raspberry pis do:

  • sudo raspi-config and enable the camera module (and ssh if desired)

  • install the LCD screen; depending on your screen, use:

    • RPi Display (aliexpress; here 3.5 inch MPI3501): git clone https://github.com/goodtft/LCD-show.git && cd LCD-show && chmod +x LCD* && sudo ./LCD35-show 180; change rotation (180) later with sudo ./rotate.sh [rotation]

Manual compilation OpenCV

Alternatively, you may manually compile OpenCV.

Compile OpenCV 4.0+, including Python (3) bindings (6min on my core i7) https://www.pyimagesearch.com/2018/08/15/how-to-install-opencv-4-on-ubuntu/

export OPENCV=4.1.2  # 2019-10-10
wget -O opencv.zip https://github.com/opencv/opencv/archive/$OPENCV.zip
wget -O opencv_contrib.zip https://github.com/opencv/opencv_contrib/archive/$OPENCV.zip
unzip opencv.zip && unzip opencv_contrib.zip
mv opencv-$OPENCV opencv && mv opencv_contrib-$OPENCV opencv_contrib

mkdir -p opencv/build/ && cd opencv/build
cmake -D CMAKE_BUILD_TYPE=RELEASE \
-D CMAKE_INSTALL_PREFIX=/usr/local \
-D INSTALL_PYTHON_EXAMPLES=ON \
-D INSTALL_C_EXAMPLES=OFF \
-D OPENCV_ENABLE_NONFREE=ON \
-D OPENCV_EXTRA_MODULES_PATH=$PWD/../../opencv_contrib/modules \
-D PYTHON_EXECUTABLE=$(which python3) \
-D PYTHON2_EXECUTABLE=$(which python2) \
-D BUILD_EXAMPLES=ON ..
make -j5
sudo make install

Tools

Inference on webcams

We can run various inference algorithms on streams of images (e.g., webcams or folders with images).

Example:

export PYTHONPATH="$PWD:$PYTHONPATH"
python3 apps/viewer.py -i 0 1 2 -f classic.OpticalFlow

You can find all available algorithms with:

grep "(\w+)\(Inference\)" -Eo inference -r

For more notes, see the doc/ directory.

cvlab's People

Contributors

turiphro avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

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.