Giter Club home page Giter Club logo

cmt's Introduction

Introduction

CMT (Consensus-based Matching and Tracking of Keypoints for Object Tracking) is a novel keypoint-based method for long-term model-free object tracking in a combined matching-and-tracking framework. Details can be found on the project page and in our publication. The Python implementation in this repository is platform-independent and runs on Linux, Windows and OS X.

License

CMT is freely available under the 3-clause BSD license, meaning that you can basically do with the code whatever you want. If you use our algorithm in scientific work, please cite our publication

@inproceedings{Nebehay2015CVPR,
    author = {Nebehay, Georg and Pflugfelder, Roman},
    booktitle = {Computer Vision and Pattern Recognition},
    month = jun,
    publisher = {IEEE},
    title = {Clustering of {Static-Adaptive} Correspondences for Deformable Object Tracking},
    year = {2015}
}

Dependencies

  • Python
  • OpenCV-Python (>= 2.4, < 3)
  • NumPy
  • SciPy
  • optional: ipdb (for debugging the code)

Note for Windows users: if you are unable to read video files, please follow this suggestion: http://stackoverflow.com/questions/11699298/opencv-2-4-videocapture-not-working-on-windows

Usage

usage: run.py [-h] [--challenge] [--preview] [--no-preview] [--no-scale]
               [--no-rotation] [--bbox BBOX] [--pause] [--output-dir OUTPUT]
               [--quiet]
               [inputpath]

Optional arguments

  • inputpath The input path.
  • -h, --help show help message and exit
  • --challenge Enter challenge mode.
  • --preview Force preview
  • --no-preview Disable preview
  • --no-scale Disable scale estimation
  • --with-rotation Enable rotation estimation
  • --bbox BBOX Specify initial bounding box. Format: x,y,w,h
  • --pause Pause after each frame
  • --skip N Skips N frames of the video input
  • --output-dir OUTPUT Specify a directory for output data.
  • --quiet Do not show graphical output (Useful in combination with --output-dir).

Object Selection

Press any key to stop the preview stream. Left click to select the top left bounding box corner and left click again to select the bottom right corner.

Examples

When using a webcam, no arguments are necessary:

python run.py

When using a video, the path to the file has to be given as an input parameter:

python run.py /home/cmt/test.avi

It is also possible to specify the initial bounding box on the command line.

python run.py --bbox=123,85,60,140 /home/cmt/test.avi

Use a sequence of numbered image files as an input:

python run.py sequence_dir/{:08d}.jpg

Here, {:08d} is a python format string that is expanded to 00000001.jpg, 00000002.jpg, etc.

cmt's People

Contributors

arthurbenemann avatar bryant1410 avatar colincsl avatar gnebehay avatar joelgallant avatar kornerc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cmt's Issues

Segmentation fault (core dumped)

I'm getting a core dumped fault on ubuntu 14.04 when I run the command
CMT$ python run.py challenge.mp4

challenge.mp4 is located in the CMT directory.

Any help with that is appreciated

Any plans to support OpenCV > 3

As opencv is now available at 3.1, are there any plans to upgrade CMT to work with 3.1
If not is there a particular sweet spot of OpenCV 3 that you found works ?

Need help with an error.

I am constantly getting the error below. Can someone help? I have modified the code to run for multiple objects by initializing it with a new region to start with. Please help. It stops throwing this error at times.
Thanks.

File "run2.py", line 136, in
CMT.process_frame(im_gray)
File "/home/shuchita/Documents/Internship/CMT-master/CMT.py", line 245, in process_frame
selected_matches_all = self.matcher.knnMatch(features, self.selected_features, len(self.selected_features))
TypeError: object of type 'NoneType' has no len()

CMT not reading files

So the original issue was:
"I am trying to run CMT on some of the provided data sets and I am encountering the OpenCV error: Assertion failed (scn == 3 || scn == 4). Any Idea what could be causing this? seems to be called in run.py at line 104."
This seems to be alleviated by adding:
if len(im0.shape) == 3:
im_gray0 = cv2.cvtColor(im0,cv2.COLOR_BGR2GRAY)
else:
im_gray0 = im0
this in turn revealed what I think was the underlying issue. I keep getting that im0 is equal to None or None type meaning that either the program is not finding the specified files of the first frame is blank or "dead". I have looked around and have found some suggestions to try to fix this problem. Most add some code like :
" frame=cvQueryFrame(capture);
if (frame..empty()) break;"
(code from: http://stackoverflow.com/questions/21871540/opencv-error-assertion-failed-scn-3-scn-4?lq=1)

or:
if defects is None: else:

I am trying to fix it but being relatively new to Python I cannot get the program to rid the given video files, both color or gray scale.

CMT for multiple objects

Can CMT be used for multiple objects in a frame? If yes, please suggest the best way that could be possible.

Question on Key points

When using sample files there seem to be some differences in the outputs shown than to my result. Number of key points is less in my outputs then in shown results. Key points are also tightly cluster in center of box, all in center are coloured blue. Any points not in exact center of Box are white. None are green like samples, why did this change, is this for newer versions? Also in results like cup on table, the cup is not tracked and is lost very easily by program. I can post output if needed. Sorry for bad english.

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.