[mousetrap/ng] Added haar points detection



commit 3c8dea843e0823f2e7a2b3d1a9e9012728394276
Author: Flavio Percoco Premoli <flaper87 gmail com>
Date:   Mon Jan 18 01:37:00 2010 +0100

    Added haar points detection

 src/mousetrap/ocvfw/.cproject              |    4 +-
 src/mousetrap/ocvfw/backends/OcvfwBase.cpp |   30 ----------------------------
 src/mousetrap/ocvfw/boost/PyMtpCapture.cpp |    1 +
 src/mousetrap/ocvfw/include/OcvfwBase.h    |   23 ++++++++++++++-------
 4 files changed, 18 insertions(+), 40 deletions(-)
---
diff --git a/src/mousetrap/ocvfw/.cproject b/src/mousetrap/ocvfw/.cproject
index 15c365a..850c66f 100644
--- a/src/mousetrap/ocvfw/.cproject
+++ b/src/mousetrap/ocvfw/.cproject
@@ -24,7 +24,7 @@
 <tool id="cdt.managedbuild.tool.gnu.cpp.compiler.exe.debug.739252718" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.exe.debug">
 <option id="gnu.cpp.compiler.exe.debug.option.optimization.level.887743628" name="Optimization Level" superClass="gnu.cpp.compiler.exe.debug.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
 <option id="gnu.cpp.compiler.exe.debug.option.debugging.level.713383979" name="Debug Level" superClass="gnu.cpp.compiler.exe.debug.option.debugging.level" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
-<option id="gnu.cpp.compiler.option.include.paths.1918578046" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
+<option id="gnu.cpp.compiler.option.include.paths.1918578046" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
 <listOptionValue builtIn="false" value="/usr/include/opencv"/>
 <listOptionValue builtIn="false" value="/usr/include/glibmm-2.4"/>
 <listOptionValue builtIn="false" value="/usr/include"/>
@@ -38,7 +38,7 @@
 <tool id="cdt.managedbuild.tool.gnu.c.compiler.exe.debug.1993074788" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.exe.debug">
 <option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.exe.debug.option.optimization.level.650675947" name="Optimization Level" superClass="gnu.c.compiler.exe.debug.option.optimization.level" valueType="enumerated"/>
 <option id="gnu.c.compiler.exe.debug.option.debugging.level.1139515112" name="Debug Level" superClass="gnu.c.compiler.exe.debug.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/>
-<option id="gnu.c.compiler.option.include.paths.886641972" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath"/>
+<option id="gnu.c.compiler.option.include.paths.886641972" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths"/>
 <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.430443262" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
 </tool>
 <tool id="cdt.managedbuild.tool.gnu.c.linker.exe.debug.913841576" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.exe.debug">
diff --git a/src/mousetrap/ocvfw/backends/OcvfwBase.cpp b/src/mousetrap/ocvfw/backends/OcvfwBase.cpp
index 6a3962c..73b1b60 100644
--- a/src/mousetrap/ocvfw/backends/OcvfwBase.cpp
+++ b/src/mousetrap/ocvfw/backends/OcvfwBase.cpp
@@ -23,8 +23,6 @@
  * TODO: set
  * TODO: lk_swap
  * TODO: set_camera_idx
- * TODO: start_camera
- * TODO: query_image
  * TODO: set_lkpoint
  * TODO: clean_lkpoints
  * TODO: show_lkpoints
@@ -43,22 +41,6 @@ IplImage *frame=0;
 IplImage *small_frame=0;
 IplImage *frame_copy=0;
 
-/**
- * Image Width of Webcam
- */
-#define IMAGE_WIDTH 320
-
-/*
- * Image Height of Webcam
- */
-#define IMAGE_HEIGHT 240
-
-/*
- * Image Height of Webcam
- */
-#define SMALL_FRAME_SCALE 1.5
-
-
 OcvfwBase::OcvfwBase() {
 }
 
@@ -112,15 +94,3 @@ int OcvfwBase::waitKey(int num) {
 	return cvWaitKey(num);
 }
 
-int OcvfwBase::getHaarPoints(IplImage* img, char* haarclassifier) {
-	CvHaarClassifierCascade* cascade;
-
-	cascade = (CvHaarClassifierCascade*)cvLoad(haarclassifier, 0, 0, 0);
-
-	if (cascade) {
-		small_frame = this->newImage( cvSize(IMAGE_WIDTH/SMALL_FRAME_SCALE,IMAGE_HEIGHT/SMALL_FRAME_SCALE), IPL_DEPTH_8U, img->nChannels );
-		cvResize(img, small_frame, CV_INTER_LINEAR);
-		cvClearMemStorage(this->storage);
-	}
-}
-
diff --git a/src/mousetrap/ocvfw/boost/PyMtpCapture.cpp b/src/mousetrap/ocvfw/boost/PyMtpCapture.cpp
index f19b618..bfe8716 100644
--- a/src/mousetrap/ocvfw/boost/PyMtpCapture.cpp
+++ b/src/mousetrap/ocvfw/boost/PyMtpCapture.cpp
@@ -81,5 +81,6 @@ BOOST_PYTHON_MODULE(camera)
 			.def("resize", &Capture::resize)
 			.def("set_async", &Capture::set_async)
 			.def("sync", &Capture::sync)
+			.def("get_haar_points", &Capture::getHaarPointsPython)
 	;
 }
diff --git a/src/mousetrap/ocvfw/include/OcvfwBase.h b/src/mousetrap/ocvfw/include/OcvfwBase.h
index 19082b8..d4e9a2d 100644
--- a/src/mousetrap/ocvfw/include/OcvfwBase.h
+++ b/src/mousetrap/ocvfw/include/OcvfwBase.h
@@ -28,6 +28,21 @@
 #define OCVFWBASE_H_
 
 /**
+ * Image Width of Webcam
+ */
+#define IMAGE_WIDTH 320
+
+/*
+ * Image Height of Webcam
+ */
+#define IMAGE_HEIGHT 240
+
+/*
+ * Image Height of Webcam
+ */
+#define SMALL_FRAME_SCALE 1.5
+
+/**
  * Base Framework class.
  */
 class OcvfwBase
@@ -74,14 +89,6 @@ public:
      */
     void stopCamera();
 
-    /**
-     * Get Detected Region using Input Haar Cascade
-     * @param The current Image
-     * @param Haar Cascade Path
-     * @result returns 1 for Sucess and 0 for Failure
-     */
-    int getHaarPoints(IplImage* img, char* haarclassifier) ;
-
 
 private:
     /**



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]