Giter Site home page Giter Site logo

microcompunics / opencv-unity3d-object-tracking Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hasanavi/opencv-unity3d-object-tracking

0.0 2.0 0.0 24 KB

OpenCV Object Tracking using CamShift algorithm and Unity3d Mashup

Python 58.61% C# 41.39%

opencv-unity3d-object-tracking's Introduction

OpenCV and Unity3D integration.

A simple way to connect Opencv with Unity3D using socket.

I've used Open CV Camshift algorithm to detect and track object in Python. Then I send the position of the object into Unity 3D using UDP Socket, read the stream from Unity 3D and change the position of a game object.... Pretty simple.

Here is the demo video - https://www.youtube.com/watch?v=aE4_VtUDORw

In order to make this demo work

  1. You need to install Unity3D (http://unity3d.com)
  2. Install and configure Python and OpenCV (https://opencv-python-tutroals.readthedocs.org/en/latest/py_tutorials/py_setup/py_setup_in_windows/py_setup_in_windows.html#install-opencv-python-in-windows)
  3. Change the 3rd line of OpenCV/gameDemo.py to appropriate installation directory of OpenCv
  4. Run the OpenCV/gameDemo.py
  5. Drag your mouse over an object. You will find the program start tracking it while you change position. The position will be printed in the command line.
  6. Open the Unity3d Scene Unity3D/Assets/Scenes/socketTest.unity in Unity3D
  7. Run the game and you will find the Unity's game object is following the real life tracked object

I'm just a tweet away (https://twitter.com/hasanavi) if you find any problem. For other contact details. http://hasanavi.me/

License

This is strictly WTFPL (http://en.wikipedia.org/wiki/WTFPL) license ;)

opencv-unity3d-object-tracking's People

Contributors

andreierdoss avatar hasanavi avatar

Watchers

 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.