GithubHelp home page GithubHelp logo

indoortracking's Introduction

Detecting People in Cluttered Indoor Scenes

The task given is essentially a combination of two sub-problems, 1. Capturing the silhouettes of people present in the room and 2. Extracting enough information from the environment and the silhouettes of each person, to project the same on to the top view.

Assumptions

- Human beings are the only moving objects
- The orientation of the camera is known

Silhouette or Blob detection

I came across three different ways of doing this, with reasonable performance in real time. In all of them, motion tracking is the primary activity. Background subtraction yields great results but it is also very sensitive to noise. Optical flow is very accurate compared to other methods, but it is incredibly slow, to run in real time, unless run on a GPU with a good parallel algorithm. The best solution seems to be temporal differencing. I read a paper on it, Detecting People in Cluttered Indoor Scenes, and attempted to implement it. They use Tensor Voting for removing outliers, noise and also to assign a signature to each collection of points (contours) for classification (as human/objects). Tensor voting is a sophisticated technique which needs to be implemented in a parallel manner, in order use it in real time applications.

The algorithm I used is rather simple. Difference image is calculated from previous, current and next frames, which is binarized (threshold is a heuristic). Noise in the image are removed by morphological operations, eroding and dilating, following which contours are collected from the image. The contours that are close together are grouped together by finding the convex hull for each pairs of contours. This process provides very good contours, from which the bottom most point in the contour is marked a the coordinate of that moving object.

Perspective Transform

I used homography to transform the perspective view from the camera to top view. This process is unfortunately too complex to be automated (use of markers in the scene). Instead I gathered 4 points ( a,b,c,d) from the scene, which represent the floor, to be seen from the top view. By transforming these four points to the end points of our top view [ 0,0),(w,0),(w,h),(0,h) ], we get the transformation matrix H. Using H, the view is warped to the top view. The size of the top view is environment specific and should be entered by the user. Watch the demo video I have attached, to see how I gather 4 points for homography.

The coordinates obtained from the first part, are transformed by matrix multiplying it with H. The multiplication should be of the form ( h x [x1,y1,1] = [x2,y2,1] ). The new coordinated are then plotted on the warped view.

Drawbacks

This implementation is simplistic, in many ways, starting with the fact that it can track only moving objects. Multiple people could be grouped into the same blob. A person can be put in two or more different blobs. The plotting of coordinates in the top view is noisy, which can be corrected by using moving average and clustering closer coordinates. Given enough time, these problems can be addressed with patience and solved and the accuracy of tracking can be improved greatly.

indoortracking's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

indoortracking's Issues

.config file is missing

hi @suriyadeepan
i tried to run your code ,but when i run this command "python differnence_flow.py "
i met this error :
Traceback (most recent call last):
File "differnence_flow.py", line 61, in
config = hkl.load('.config')
File "/home/sojoyoo/miniconda2/lib/python2.7/site-packages/hickle.py", line 616, in load
h5f = file_opener(fileobj)
File "/home/sojoyoo/miniconda2/lib/python2.7/site-packages/hickle.py", line 154, in file_opener
h5f = h5.File(filename, mode)
File "/home/sojoyoo/miniconda2/lib/python2.7/site-packages/h5py/_hl/files.py", line 272, in init
fid = make_fid(name, mode, userblock_size, fapl, swmr=swmr)
File "/home/sojoyoo/miniconda2/lib/python2.7/site-packages/h5py/_hl/files.py", line 92, in make_fid
fid = h5f.open(name, flags, fapl=fapl)
File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper (/tmp/pip-4rPeHA-build/h5py/_objects.c:2684)
File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper (/tmp/pip-4rPeHA-build/h5py/_objects.c:2642)
File "h5py/h5f.pyx", line 76, in h5py.h5f.open (/tmp/pip-4rPeHA-build/h5py/h5f.c:1930)
IOError: Unable to open file (Unable to open file: name = '.config', errno = 2, error message = 'no such file or directory', flags = 0, o_flags = 0)

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.