Difference between revisions of "CamShift"

From wikidb
Jump to: navigation, search
(C++)
(C++)
Line 8: Line 8:
  
 
   eepp@hood:~/opencv/camshift$ ./camshiftdemo &
 
   eepp@hood:~/opencv/camshift$ ./camshiftdemo &
  [1] 3061
 
  eepp@hood:~/opencv/camshift$
 
 
   This is a demo that shows mean-shift based tracking
 
   This is a demo that shows mean-shift based tracking
 
   You select a color objects such as your face and it tracks it.
 
   You select a color objects such as your face and it tracks it.

Revision as of 15:43, 27 July 2015

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

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