2010/01/18

build handvu-beta3 on ubuntu

HandVu 是一套利用 OpenCV 來做手勢控制的函式庫,作者大概已經沒空再維護了, 有興趣的人可以自行參考。

在 ubuntu 9.10 上編譯,建議使用 OpenCV 1.0, 但是會遇到幾個錯誤,底下把 Patch 貼上來

diff -ruN handvu-beta3/cubicles/CascadeFileParser.yy handvu/cubicles/CascadeFileParser.yy
--- handvu-beta3/cubicles/CascadeFileParser.yy 2004-10-10 01:04:53.000000000 +0800
+++ handvu/cubicles/CascadeFileParser.yy 2010-01-18 09:24:21.000000000 +0800
@@ -60,6 +60,7 @@
////////////////////////////////////////////////////////////////////

%{
+#include <string.h>
#include "Cascade.h"
#include "Classifiers.h"
#include "IntegralFeatures.h"
diff -ruN handvu-beta3/cubicles/IntegralFeatures.cpp handvu/cubicles/IntegralFeatures.cpp
--- handvu-beta3/cubicles/IntegralFeatures.cpp 2005-10-29 01:47:04.000000000 +0800
+++ handvu/cubicles/IntegralFeatures.cpp 2010-01-18 09:19:54.000000000 +0800
@@ -62,6 +62,9 @@
////////////////////////////////////////////////////////////////////


+#include <limits.h>
+#include <alloca.h>
+
#include "cubicles.hpp"
#include "IntegralFeatures.h"
#include "Exceptions.h"
diff -ruN handvu-beta3/cubicles/IntegralFeaturesSame.cpp handvu/cubicles/IntegralFeaturesSame.cpp
--- handvu-beta3/cubicles/IntegralFeaturesSame.cpp 2004-11-11 09:58:58.000000000 +0800
+++ handvu/cubicles/IntegralFeaturesSame.cpp 2010-01-18 09:20:34.000000000 +0800
@@ -65,6 +65,7 @@
////////////////////////////////////////////////////////////////////


+#include <alloca.h>
#include "cubicles.hpp"
#include "IntegralFeatures.h"
#include "Exceptions.h"
diff -ruN handvu-beta3/cubicles/IntegralImage.cxx handvu/cubicles/IntegralImage.cxx
--- handvu-beta3/cubicles/IntegralImage.cxx 2005-02-12 10:00:59.000000000 +0800
+++ handvu/cubicles/IntegralImage.cxx 2010-01-18 09:41:57.000000000 +0800
@@ -64,6 +64,8 @@
////////////////////////////////////////////////////////////////////


+#include <stdio.h>
+#include <string.h>
#include <math.h>
#include <ostream>

diff -ruN handvu-beta3/cubicles/Scanner.h handvu/cubicles/Scanner.h
--- handvu-beta3/cubicles/Scanner.h 2005-02-12 10:00:59.000000000 +0800
+++ handvu/cubicles/Scanner.h 2010-01-18 09:41:34.000000000 +0800
@@ -63,6 +63,7 @@
#ifndef __SCANNER_H
#define __SCANNER_H

+#include <limits.h>
#include "IntegralImage.h"
#ifdef HAVE_FLOAT_H
#include <float.h>
diff -ruN handvu-beta3/handvu/CubicleWrapper.cpp handvu/handvu/CubicleWrapper.cpp
--- handvu-beta3/handvu/CubicleWrapper.cpp 2005-10-31 05:16:03.000000000 +0800
+++ handvu/handvu/CubicleWrapper.cpp 2010-01-18 09:53:24.000000000 +0800
@@ -21,6 +21,7 @@
* $Id: CubicleWrapper.cpp,v 1.13 2005/10/30 21:16:03 matz Exp $
**/

+#include <limits.h>
#include "Common.h"
#include "CubicleWrapper.h"
#include "HandVu.hpp"
diff -ruN handvu-beta3/handvu/FileHandling.cpp handvu/handvu/FileHandling.cpp
--- handvu-beta3/handvu/FileHandling.cpp 2005-08-16 08:14:26.000000000 +0800
+++ handvu/handvu/FileHandling.cpp 2010-01-18 10:12:57.000000000 +0800
@@ -21,6 +21,13 @@
* $Id: FileHandling.cpp,v 1.6 2005/08/16 00:14:26 matz Exp $
**/

+#include <string.h>
+
#include "Common.h"
#include "FileHandling.h"
#include "Exceptions.h"
@@ -135,8 +142,8 @@
fname[0] = 0;
ext[0] = 0;

- char* slashpos = strrchr(path, '/');
- char* dotpos = strrchr(path, '.');
+ char* slashpos = strrchr((char*)path, '/');
+ char* dotpos = strrchr((char*)path, '.');

if (slashpos==NULL) {
if (dotpos==NULL) {
diff -ruN handvu-beta3/handvu/HandVu.cpp handvu/handvu/HandVu.cpp
--- handvu-beta3/handvu/HandVu.cpp 2006-01-04 08:55:29.000000000 +0800
+++ handvu/handvu/HandVu.cpp 2010-01-18 09:50:37.000000000 +0800
@@ -24,6 +24,7 @@
// HandVu.cpp: main library implementation file
//

+#include <limits.h>
#include "Common.h"
#include "CubicleWrapper.h"
#include "Skincolor.h"
diff -ruN handvu-beta3/handvu/Mask.cpp handvu/handvu/Mask.cpp
--- handvu-beta3/handvu/Mask.cpp 2005-08-16 08:14:26.000000000 +0800
+++ handvu/handvu/Mask.cpp 2010-01-18 10:01:45.000000000 +0800
@@ -21,6 +21,8 @@
* $Id: Mask.cpp,v 1.7 2005/08/16 00:14:26 matz Exp $
**/

+#include <cstring>
+#include <stdlib.h>
#include "Common.h"
#include "Mask.h"
#include "Exceptions.h"

0 意見: