btwotch    

, Deutschland · männlich · registriert seit 2008 · heute zuletzt online


mailto, against spam!

Ieee #eggdrop contest

Sonstiges · · 2 Kommentare

16. Juli 2011 17:07

Tags:

04. Juli 2011

Sonstiges ·

Egg drop contest soon @fim.uni-passau

09. Juli 2011 22:49

Tags:

Problems with Mac OS X

Computer ·

  • vlc is not in the "Mac App Store" - you have to download it manually ...
  • you have to reboot Mac OS X after i'Life installation
  • you cannot activate "File Vault" when your home directory is on a case-sensitive Mac OS X extended partition :facepalm:
    moreover you cannot convert to case-insensitive partition ... (https://discussions.apple.com/thread/1578457?start=0&tstart=0)
  • best thing: to use only one display you have to:

  1. activate mirror mode for displays
  2. close your macbook
  3. wait until macbook is in standby
  4. press a key on usb keyboard
  5. login (screen lock)
  6. correct screen resolution

steps 2-5 have to be done after every power-on :facepalm:

27. Juni 2011 22:06

Tags:  ·  ·  ·  ·

25. Juni 2011

Sonstiges ·

Impression #gpn11

25. Juni 2011 22:30

Tags:

Trolldetection with opencv (#gpn11 release)

Computer · · 3 Kommentare

it detects faces and puts trollface there :ok:
before:


trollface_before


after:


trollface_after


    1 #include <stdlib.h>
    2 #include <stdio.h>
    3 #include <math.h>
    4 #include <cv.h>
    5 #include <highgui.h>
    6 
    7 void draw(IplImage *img, int x, int y, int width, int height)
    8 {
    9   IplImage* troll = cvLoadImage("trollface.png", CV_LOAD_IMAGE_COLOR);
   10   IplImage* scale_troll = cvCreateImage(cvSize(width, height), img->depth,
   11                           img->nChannels);
   12 
   13   cvSetImageROI(img, cvRect(x,y,scale_troll->width,scale_troll->height));
   14   cvResize(troll, scale_troll, CV_INTER_LINEAR);
   15   cvAddWeighted(img, 0.0, scale_troll, 1.0, 0.5, img);
   16   cvResetImageROI(img);
   17 
   18   cvReleaseImage(&troll);
   19   cvReleaseImage(&scale_troll);
   20 
   21 }
   22 
   23 int main(int argc, char *argv[])
   24 {
   25   int i;
   26   double scale;
   27   IplImage* img;
   28   CvHaarClassifierCascade* cascade;
   29   CvSeq* faces;
   30   CvRect* r;
   31   CvMemStorage* storage = cvCreateMemStorage(0);
   32 
   33   cvClearMemStorage(storage);
   34 
   35   if (argc<2)
   36     {
   37       printf("Usage: main <image-file-name>\n\7");
   38       exit(0);
   39     }
   40 
   41   cascade = (CvHaarClassifierCascade*)cvLoad(
   42             "/usr/share/opencv/haarcascades/haarcascade_frontalface_default.
   43             xml", 0, 0, 0 );
   44   //cascade = (CvHaarClassifierCascade*)cvLoad(
   45               "/usr/share/opencv/haarcascades/haarcascade_frontalface_alt.
   46               xml", 0, 0, 0 );
   47 
   48 
   49   img=cvLoadImage(argv[1], CV_LOAD_IMAGE_COLOR);
   50   if (!img)
   51     {
   52       printf("Could not load image file: %s\n",argv[1]);
   53       exit(-1);
   54     }
   55 
   56   printf("Processing a %dx%d image with %d channels\n",img->width,img->
   57          height,img->nChannels);
   58 
   59   cvNamedWindow("mainWin", CV_WINDOW_AUTOSIZE);
   60   //cvMoveWindow("mainWin", 100, 100);
   61 
   62   if (!cascade)
   63     fprintf(stderr, "ERROR, no cascade loaded :(\n");
   64 
   65   scale = 1+((43e-8)*img->width*img->height);
   66   printf("scale: %f\n", scale);
   67 
   68   faces = cvHaarDetectObjects( img, cascade, storage, scale, 3,
   69           CV_HAAR_DO_CANNY_PRUNING, cvSize(40,40), cvSize(50,50) );
   70   //faces = cvHaarDetectObjects( img, cascade, storage, scale, 3,
   71             CV_HAAR_SCALE_IMAGE, cvSize(40,40), cvSize(50,50) );
   72   for ( i = 0; i < (faces ? faces->total : 0); i++ )
   73     {
   74       cvShowImage("mainWin", img );
   75       cvWaitKey(0);
   76 
   77       printf("face\n");
   78       r = (CvRect*)cvGetSeqElem(faces, i);
   79       //cvRectangle(img, cvPoint( r->x, r->y ), cvPoint( r->x + r->width, r-
   80                     >y + r->height ), colors[i%8], 5, 8, 0);
   81       draw(img, r->x, r->y, r->width, r->height);
   82     }
   83   cvShowImage("mainWin", img );
   84 
   85   cvWaitKey(0);
   86   cvSaveImage("Result.jpg", img, 0);
   87 
   88   cvReleaseImage(&img);
   89   cvDestroyWindow("mainWin");
   90   return 0;
   91 }

Makefile:

gcc troll.c -o troll -lm -lopencv_highgui -lopencv_objdetect -I /usr/include/opencv/ -Wall -g
25. Juni 2011 12:14

Tags:  ·  ·  ·  ·  ·  ·  ·

08. Juni 2011

Sonstiges · · 3 Kommentare

Club mate and ice-t now available in passau diagonally opposite wiwi faculty

08. Juni 2011 13:20

Tags:

Download your fav pics from flickr

Technologie / Wissenschaft · · 1 Kommentar

Imagine you have faved a lot of pics on flickr and now want to download them; of course you could do that easy in perl - BUT you can do this easy in C, too :popcorn: For this purpose we use flickcurl; it helps us a lot (especially with the authentication - as you know I hate complicated authentication methods - especially ntlm!)

Some Presteps:

  1. get api key and shared secret: http://librdf.org/flickcurl/api/flickcurl-auth-register.html
  2. get authentication token: http://librdf.org/flickcurl/api/flickcurl-auth-authenticate.html


    1 #include <stdio.h>
    2 #include <flickcurl.h>
    3 
    4 #define USERNSS "63169079@N05"
    5 #define MAX_PAGES 500
    6 
    7 int main()
    8 {
    9   int i, page;
   10   char *url;
   11 
   12   flickcurl *fc;
   13   flickcurl_photos_list *pl;
   14   flickcurl_photos_list_params list_params;
   15 
   16   flickcurl_init();
   17 
   18   fc = flickcurl_new();
   19 
   20   flickcurl_set_api_key(fc, "...");
   21   flickcurl_set_shared_secret(fc, "...");
   22   flickcurl_set_auth_token(fc, "...");
   23 
   24   flickcurl_photos_list_params_init(&list_params);
   25   list_params.per_page = 10;
   26   list_params.page = 0;
   27   for (page = 0; page < MAX_PAGES; page++)
   28     {
   29       printf("page: %d\n", page);
   30       list_params.page = page;
   31 
   32       list_params.extras = "original_format";
   33       pl = flickcurl_favorites_getList_params(fc, USERNSS, &list_params);
   34       for (i = 1; i < pl->photos_count; ++i)
   35         {
   36           printf("  Result #%d has ID %s  ", i, pl->photos[i]->id);
   37           url = flickcurl_photo_as_source_uri(pl->photos[i], 'b');
   38           printf(" | url: %s\n", url);
   39           free(url);
   40         }
   41       flickcurl_free_photos_list(pl);
   42       if (pl->photos_count == 0)
   43         break;
   44     }
   45 
   46   flickcurl_free(fc);
   47   flickcurl_finish();
   48 }

Insert correctly the values you got via presteps:

    1 flickcurl_set_api_key(fc, "...");
    2 flickcurl_set_shared_secret(fc, "...");
    3 flickcurl_set_auth_token(fc, "...");

you can find these values in ~/.flickcurl.

You can find out your correctly USERNSS when you go to your flickr-favorites; now look at the URL (e.g. http://www.flickr.com/photos/63169079@N05/favorites/)

Now compile:
 gcc `flickcurl-config --cflags --libs` download_favs.c  -Wall -g

P.S.: explore flickr via pandas: http://www.flickr.com/explore/panda

05. Juni 2011 02:57

Tags:  ·  ·  ·  ·

26. April 2011

Sonstiges · · 1 Kommentar

Priest? Im a discordian pope!!

26. April 2011 18:29

Tags:

Seite 3 von 29
 ·  1 2 3 4 5 6..29 · 
Blog durchsuchen
(nur öffentliche Einträge)

Willst du auch bloggen?
Kostenlos bloggen bei Spin.de
Diese Seite ist eine auf spin.de gelagerte persönliche Homepage, deren Verantwortlichkeit beim Nutzer liegt.
spin.de ist eine große Online-Community mit Chat, Blogs, Foren, Online-Spielen und vielem mehr.
Deine eigene Homepage mit Blog und Gästebuch

Impressum · Datenschutz · Sitemap