CamShift

From wikidb
Revision as of 16:00, 27 July 2015 by Edc (Talk | contribs)

Jump to: navigation, search

C++

camshiftdemo.cpp is found in version 2.4 samples.

 g++ camshiftdemo.cpp -o camshiftdemo -L /usr/local/lib -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_video

Run

 eepp@hood:~/opencv/camshift$ ./camshiftdemo &
 This is a demo that shows mean-shift based tracking
 You select a color objects such as your face and it tracks it.
 This reads from video camera (0 by default, or the camera number the user enters
 Usage: 
    ./camshiftdemo [camera number]
 
 
 Hot keys: 
         ESC - quit the program
         c - stop the tracking
         b - switch to/from backprojection view
         h - show/hide object histogram
         p - pause video
 To initialize tracking, select the object with mouse
 init done 
 opengl support available 
 pure virtual method called
 terminate called without an active exception

See below for screen captures.

Old C

With Synaptic added

  • opencv-doc

camshiftdemo.c is found in /usr/share/doc/opencv-doc/examples/c. To compile:

gcc -I /usr/include/opencv-2.3.1/opencv/ -I /usr/include/opencv-2.3.1 
   -lm -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_legacy 
   camshiftdemo.c -o camshiftdemo

to run:

root@tabor:c# ./camshiftdemo 
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
VIDIOC_QUERYMENU: Invalid argument
Hot keys: 
	ESC - quit the program
	c - stop the tracking
	b - switch to/from backprojection view
	h - show/hide object histogram
To initialize tracking, select the object with mouse

Historgram.jpg

CamShiftDemo.jpg