Coder Social home page Coder Social logo

cvpyexplorer's Introduction

CVPyExplorer

PROGRAMMING LANGUAGE: python2 MODULES USED: tkinter, OpenCV2, sys, os, time, numpy

Demo: https://www.youtube.com/watch?v=cuirhlLaOiE

This program uses Python 2 and OpenCV 2 to attempt to detect the user's hand. Hand detected is used to interact with the interface.

Currently works best in a monotone background with no object in the background. User may have to vary lighting to be able to detect hands properly.

Features:

Detect a single hand and obtain contour Determine center of the detected hand Track the hand over multiple frames Detect position of center of hand If, it is location mode, this position is used to interact with file explorer interface. Traditional mouse mode implemented(So, if user can't find ideal background they can still interact with software) Reading text files and opening folders Gesture Detection(moving)

Yet to be implemented:

To open files of all extensions in their respective applications Better hand detection Better Gesture detection

Installation:

MacOS: The program was written in MacOS and is favorable to users of this operating system.

Mac Installation Guide https://abhgog.gitbooks.io/open-cv-manual/content/installationenvironment-setup/mac.html

Usage:

  1. Download the modules
  2. Install code.py

For mouse mode:

  1. User presses 's' and the file manager appears
  2. The user can now interact with the buttons on the screen using mouse clicks

For location mode:

  1. User first presses 's' and the file manager appears
  2. The user then presses 'l' to allow the hand center to interact with the screen.

To detect Gesture:

  1. Press 'g' to start recording gesture

  2. Press 'g' to stop recording gesture If the gesture recorded exists, the code will implement the action

  3. Pressing 'q' closes the window and exits program

The implementation of the code is very simple, and it can be easily converted to be able to interact with other softwares.

Algorithm

Read from camera Convert image to binary color using thresholding Use OpenCV to extract contours from image Find the largest contour from detected list, which is assumed to be the hand contour Use OpenCV to find the convex hull and convexity defects of the contour Find the center of the hand by using moments Draw the convex hull, contour, center and defects on a new screen These are then displayed on tkinter Displays the folders at initial location stored, which is "/Users" for mac users. Using OS module, folders inside folders are accessed Using file handling, text files are accessed

For mouse mode, coordinates of clicks are sent and compared to location of buttons For location mode, coordinates of center of cursor are sent and compared to location of buttons For gesture detection, coordinates are recorded and compared

cvpyexplorer's People

Contributors

metafly 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.