pulling out dbus stuff from face detection
authorozzloy <ozzloy@zero7.(none)>
Sun, 31 Jan 2010 01:11:20 +0000 (17:11 -0800)
committerozzloy <ozzloy@zero7.(none)>
Sun, 31 Jan 2010 01:11:20 +0000 (17:11 -0800)
.gitignore
Makefile
hello-world.cpp

index 3268211916343c21be8754cb71fd8c03119dff01..b33fd92599e97bdbdd4b4bce7c2ecbb0a3fee380 100644 (file)
@@ -1 +1,3 @@
 .*.sw?
+hello-world
+
index fd1361f0d5a9270af520d369adbaf0720b6136a6..dc5f06f4b554961232a806320c91a5222db05cb2 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -12,4 +12,6 @@ test: all
 clean:
        rm -rf hello-world tags dbushello
 
+new: clean all
+
 .PHONY: clean
index c88efece67127c59a22a98a1b2e648faeb5d9f95..12c666e1090ef8904d23378f4da7169805f87dcb 100644 (file)
 #include <highgui.h>
 #include <stdio.h>
 #include <iostream>
-#include <dbus/dbus.h>
-#include <dbus/dbus-glib.h>
+//#include <dbus/dbus.h>
+//#include <dbus/dbus-glib.h>
 
 using namespace std;
 
-DBusGConnection *connection;
-GError *error;
-DBusGProxy *proxy;
-char **name_list;
-char **name_list_ptr;
+//DBusGConnection *connection;
+//GError *error;
+//DBusGProxy *proxy;
+//char **name_list;
+//char **name_list_ptr;
 
 
 // argument for cvFlip(src, dest, FLIP_TYPE)
@@ -81,19 +81,21 @@ void detect_and_draw_objects(IplImage* image,
        faces = cvHaarDetectObjects(small_image, cascade, storage, 1.2, 2,
                        CV_HAAR_DO_CANNY_PRUNING);
 
+       /*
        if(0 < faces->total)
        {
                dbus_g_proxy_call_no_reply(proxy, "SimulateUserActivity", G_TYPE_INVALID);
        }
+       */
 
        /* draw all the rectangles */
        for(i = 0; i < faces->total; i++)
        {
                /* extract the rectangles only */
                CvRect face = *(CvRect*)cvGetSeqElem(faces, i);
-               CvPoint upperLeft = cvPoint(face.x*scale,face.y*scale);
-               CvPoint bottomRight = cvPoint((face.x+face.width)*scale,
-                               (face.y+face.height)*scale);
+               CvPoint upperLeft = cvPoint(face.x * scale, face.y * scale);
+               CvPoint bottomRight = cvPoint((face.x + face.width) * scale,
+                               (face.y + face.height) * scale);
                cvRectangle(image, upperLeft, bottomRight, CV_RGB(255,0,0), 3);
        }
 
@@ -105,25 +107,27 @@ void detect_and_draw_objects(IplImage* image,
 // A Simple Camera Capture Framework.
 int main(int argc, char** argv)
 {
-       g_type_init ();
+//     g_type_init ();
 
-       error = NULL;
-       connection = dbus_g_bus_get (DBUS_BUS_SESSION,
-                       &error);
-       if (connection == NULL)
+       //error = NULL;
+       //connection = dbus_g_bus_get (DBUS_BUS_SESSION,
+       //              &error);
+       /*if (connection == NULL)
        {
                g_printerr ("Failed to open connection to bus: %s\n",
                                error->message);
                g_error_free (error);
                exit (1);
-       }
+       }*/
 
        /* Create a proxy object for the "bus driver" (name "org.freedesktop.DBus") */
 
+       /*
        proxy = dbus_g_proxy_new_for_name (connection,
                        "org.gnome.ScreenSaver",
                        "/org/gnome/ScreenSaver",
                        "org.gnome.ScreenSaver");
+                       */
 
        CvHaarClassifierCascade* cascade = load_object_detector(argv[1]);