Difference between revisions of "CamShift"

From wikidb
Jump to: navigation, search
(C++)
(Compile)
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
== C++ ==
 
== C++ ==
  
camshiftdemo.cpp is found in version 2.4 [https://github.com/Itseez/opencv/blob/2.4/samples/cpp/camshiftdemo.cpp samples].
+
=== Compile ===
 +
camshiftdemo.cpp is found in version 2.4 [https://github.com/Itseez/opencv/blob/2.4/samples/cpp/ samples].
 +
 
 +
* [https://github.com/Itseez/opencv/blob/2.4/samples/cpp/camshiftdemo.cpp CamShift Demo]
 +
* [http://fossies.org/dox/opencv-3.1.0/camshiftdemo_8cpp.html CamShift File Reference]
 +
* [http://docs.ros.org/diamondback/api/control_toolbox/html/classcontrol__toolbox_1_1Pid.html PID Reference]
  
 
   g++ camshiftdemo.cpp -o camshiftdemo -L /usr/local/lib -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_video
 
   g++ camshiftdemo.cpp -o camshiftdemo -L /usr/local/lib -lopencv_core -lopencv_imgproc -lopencv_highgui -lopencv_video
  
Run
+
=== Run ===
  
 
   eepp@hood:~/opencv/camshift$ ./camshiftdemo &
 
   eepp@hood:~/opencv/camshift$ ./camshiftdemo &
Line 26: Line 31:
 
   pure virtual method called
 
   pure virtual method called
 
   terminate called without an active exception
 
   terminate called without an active exception
 +
 +
See below for screen captures.
 +
 +
=== Links ===
 +
 +
* [http://docs.opencv.org/master/db/df8/tutorial_py_meanshift.html#gsc.tab=0 Python Meanshift and Camshift]
  
 
== Old C ==
 
== Old C ==
 +
 +
2012 on fitPC
  
 
With Synaptic added
 
With Synaptic added

Latest revision as of 12:44, 8 July 2016

C++

Compile

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.

Links

Old C

2012 on fitPC

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