Sign in
Published by: ganglio @ 17:15
06
Apr/11
q1

It really looks like I cannot stay doing nothing.
I grabbed the script I use to download my posts for the Everyday app and changed it a bit so I could download plenty of other people pictures.
416 to be precise.

I averaged all of them and this is the result:

average you

Cool, isn’t it? It’s a sort of daily ghost :þ

If you fancy to give it a try here is the script I used to fetch the images:

  1. <?php
  2.  
  3. $numpages=10;
  4. $maxresults=100;
  5. $baselink="http://search.twitter.com/search.json";
  6. $query="?q=@everydayapp&result_type=recent&rpp=$maxresults";
  7.  
  8. for ($i=0; $i<$numpages; $i++) {
  9.   $results=json_decode(file_get_contents($baselink.$query));
  10.  
  11.   foreach ($results->results as $kk=>$result) {
  12.     preg_match("/http:\/\/yfrog\.com\/([a-z-0-9]*)/",$result->text,$matches);
  13.     $hash=$matches[1];
  14.  
  15.     if ($hash) {
  16.       $xmlInfo=simplexml_load_string(file_get_contents("http://yfrog.com/api/xmlInfo?path=$hash"));
  17.       $link=$xmlInfo->links->image_link;
  18.  
  19.       $filename=explode("/",parse_url($link,PHP_URL_PATH));
  20.       $filename=$filename[3];
  21.       file_put_contents($filename,file_get_contents($link));
  22.     }
  23.  
  24.     echo "P:$i R:$kk H:$hash\n";
  25.   }
  26.   $query=$results->next_page;
  27. }
  28. ?>

and here is the console commands I used to calculate the average above and the standard deviation below:

  1. convert samples/* -average average.jpg
  2. for i in `ls samples`; do composite average.jpg samples/$i  -compose difference diff/$i; done
  3. for i in `ls diff`; do composite diff/$i diff/$i  -compose multiply mult/$i; done
  4. convert mult/* -average sd.jpg

standard deviation

The original SD image was quite dark so I normalised its histogram a bit with the GIMP.

Leave a comment
 
One comment
  1. grazia
    se la media era oltre, la deviazione standard è da matti...wow, e meno male che avete anche una vita sociale altrimenti chissà cosa uscirebbe da queste geniali menti
    2011-05-06 18:17:17