GithubHelp home page GithubHelp logo

gesture-recognition's Introduction

gesture-recognition

install cmake, opencv2, run as below insturctions:

cmake .
make
./main

how to use

Gesture gesture(im);
// 存在手返回true, 否则false
gesture.HasHand();
// 返回的vector的大小为空,则没有手势匹配;1,匹配一字;2,匹配八字;
gesture.getFingerLocation(std::vector<cv::Point>)

step 1: find the hand

step 2: compared with template gestures by similarity

step 3: find the finger point by max convex

step 4: calculate convexity defects

step 5: keep the contours which depth > threshold, find the finger point

install cuda

install opencv with gpu support

sudo apt-get -y update
sudo apt-get -y upgrade
sudo apt-get -y dist-upgrade
sudo apt-get -y autoremove
# Build tools:
sudo apt-get install -y build-essential cmake make
sudo apt-get install -y libvtk6-dev qt5-default 
# Media I/O:
sudo apt-get install -y zlib1g-dev libjpeg-dev libwebp-dev libpng-dev libtiff5-dev libjasper-dev libopenexr-dev libgdal-dev
# Video I/O:
sudo apt-get install -y libdc1394-22-dev libavcodec-dev libavformat-dev libswscale-dev libtheora-dev libvorbis-dev libxvidcore-dev libx264-dev yasm libopencore-amrnb-dev libopencore-amrwb-dev libv4l-dev libxine2-dev
# Parallelism and linear algebra libraries:
sudo apt-get install -y libtbb-dev libeigen3-dev
# Documentation:
sudo apt-get install -y doxygen
sudo apt-get install -y unzip wget

download from opencv 2.4.13.4

mv ~/Downloads/opencv-2.4.13.4.zip ~
unzip opencv-2.4.13.4.zip && mv opencv-2.4.13.4 opencv
cd opencv && mkdir build && cd build
cmake \
    -D CMAKE_BUILD_TYPE=DEBUG \
    -D CMAKE_INSTALL_PREFIX=/usr/local \
    -D WITH_CUDA=ON \
    -D WITH_CUBLAS=ON \
    -D CUDA_FAST_MATH=ON \
    -D WITH_CUFFT=ON \
    -D WITH_NVCUVID=ON \
    -D WITH_V4L=ON \
    -D WITH_LIBV4L=ON \
    -D WITH_OPENGL=ON \
    -D WITH_FFMPEG=ON \
    -D INSTALL_C_EXAMPLES=ON \
    -D BUILD_EXAMPLES=ON \
    ..
make -j16 && sudo make install && sudo ldconfig

after all if you want to use opencv with gpu support:

mkdir build
cmake -DCUDA_USE_STATIC_CUDA_RUNTIME=OFF ..
make
./main

gesture-recognition's People

Contributors

hzzone avatar

Watchers

 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.