Saturday 20 December 2014

No superpowers? Try programming...

My son is five and he wants a couple of things these Xmas from Santa. The first option is a flying broom, so that he can play quidditch. Not easy. The second option is a real lightsaber, so that he can fight like a real Jedi Knight. He already has one made of plastic, but apparently it doesn´t make the cut (pun intended!). Not easy either...

I have been thinking about it and came to the obvious conclusion that Santa´s job is quite difficult these days. It is not only the insane single milestone planning (who was the programme manager?). It is also the crazy requests of his customers. So I have decided to give Santa a hand this year and see what I can think of. Flying and fighting are both rather dangerous activities for children, so instead of the real thing, he will just have to make do with a similar experience. 

Many will have noticed the "Hour of Code" campaign this year. One of the videos actually says that being able to program is the closest thing we have to superpowers (min 4:58). Well, that´s what I need! Therefore the solution is relatively simple, write a program that makes him think he is flying with a broom or fighting as a Jedi Knight. Easy peasy? Not quite, but not impossible.

The idea was to create a program that streams video from the webcam to the screen, tracking the plastic lightsaber and overlaying a light on it. The result may not be professional, but the effects is still kind of nice to see in real time. In order to do this I have used cv2, yet another great library available in Python. After a bit of googling, I noticed that all I have to do is to convert the RGB frames to HSV, threshold the image to single out the area with the selected colour and create a mask which can later be coloured whichever way I want. After a couple of nights fighting with developing the code I got a working example today. I was so proud that I showed my daughter immediately to get some feedback. Her comment was, "Dad, lightsabers are not white. They are green, or blue. Or red if you are one of the baddies. But not white!". D'oh! This younger generation is definitely spoiled when it comes to expectations... 

But here we are, a working copy of the program (simple colour, no glow, sorry) to play with. From here, creating a chroma key background and tweaking the code to let him think he is flying on a broom should be a breeze! And not a minute too late.

Special thanks to the people maintaing and contributing to docs.opencv.org and stackoverflow.com. It´s always great to stand on the shoulders of giants.



In order to get the thresholds correctly, I created a calibration program to play with the HSV values. It can be downloaded here.

Tuesday 2 December 2014

Automate the boring stuff with Python

A few weeks ago I found out that Al Sweigart is preparing a new book. I decided to send him an email to ask for a draft version and, surprise, surprise, he did send it to me! Unfortunately I have not had as much spare time as I thought I would, but I have finally started reading some chapters. Looks like I will have to wait till March for the paper version though.

Something I've been wanting to do for some time was a word cloud of my blog posts. But downloading 700 posts manually was never in my head (well, almost never). Enter Al´s book and python. Following some simple instructions from the Web Scraping chapter, I have written a fifty-line program that automatically downloads every post from my blog into a single text file. From there to the chart below there is a very small step.


Monday 10 November 2014

2014 - 25 = 1989

El resto de las fotos de ayer están aquí / Some more photos can be found here



Sunday 9 November 2014

1989 + 25 = 2014


I noticed that the lamps were numbered between Potsdamer Platz and the Brandenburg Gate. The obvious thing to do was finding two significant numbers, which I did in this area.



2014 - 1989 = 25


I woke up early this morning to take some photos of the lamps along the Wall because of the 25th anniversary. As it happens, it was not early enough for all that I would have liked to do. But I still managed to get some nice shots.

Friday 31 October 2014

Parroquia de San Antonio Abad - El Toboso

Aprovechando unos días de vacaciones, hemos estado de nuevo en El Toboso. He tenido la suerte de poder dejar mi cámara y la Raspberry Pi grabando dentro de la iglesia en una mañana que estaba cerrada, así que no hay nadie en los planos.



Las secuencias en la planta baja han sido tomadas con una Canon 400D conectada a mi tableta usando la app DSLR Controller. Por alguna razón que no entiendo, hay veces que la app funciona perfectamente y otras que da mensajes de error a mitad de la secuencia.

Las secuencias desde el coro han sido tomadas con la Raspberry Pi y una Picamera. En algún momento haré una entrada con el programa en python que estoy haciendo para hacer el time lapse.

Tuesday 2 September 2014

Gente de El Toboso

Para celebrar la entrada número 700 de este blog, una entrada sin fotos, pero relacionada con la fotografía, y mucho.

Lo que comentaba hace unos meses está a punto de convertirse en realidad. En un viaje relámpago, este domingo estaré en El Toboso para inaugurar una exposición bastante especial. En las otras que he montado yo iba, ayudaba a poner las fotos en los marcos y me iba tan tranquilo, ni vernissage ni leches. Esta vez será distinto, daré la cara (al menos antes de salir pitando a pillar el avión) y estaré allí un rato, en la sala de exposiciones del Centro Cultural Miguel de Cervantes, a ver si alguien se acerca a ver las fotos.

Que cosas, tardé años en acumular las fotos de Serenity y éstas las hice todas en tres días...

Wednesday 27 August 2014

Python + Photography = Picamera


This little camera can help me enjoying both hobbies at once, programming and photography. The stand is from my first webcam, many, many years ago.

First timelapse video is done. I already found out how to connect to the Raspberry Pi through the telephone (USB tethering), so no need for a tv any more. Let the fun begin...

Saturday 9 August 2014

Holiday photographer


About a month ago I was bringing some books back to the library when I overheard a comment from somebody looking (in passing) to my photos. She said, "Oh, look, somebody´s holiday photos!"

Obviously she did not spend enough time to grasp the concept of the exhibition. Never mind. However the one above is, indeed, a holiday photo from yours truly, and a few more will follow in the next few days, as holidays are over. 

Monday 7 July 2014

Serenity? - in Arbeit (fast) versunken...


Las fotos están colgadas! La biblioteca abre de diez a ocho de lunes a viernes y los sábados de doce a cuatro.

Friday 27 June 2014

Serenity - In Gedanken versunken

La fecha de la exhibición se acerca así que es hora de empezar con los preparativos. Acabo de mandar a imprimir las fotos en un formato pequeño para poder comprobar como quedan el color y la luminosidad. También le he echado un vistazo a la página web de la biblioteca donde hago la exhibición y ya tienen puesto el texto y la foto que les mandé.

Había pensado imprimir el título de cada foto y un mapa del lugar donde la tomé. Para empezar, he hecho un mapa con todas las localizaciones precisas, aunque hay una que hice en la bibliotea de Nueva York que

no estoy muy seguro de si la incluiré al final o no. Tengo una semana para decidirme.

Dieses Projekt begann vor vielen Jahren, lange bevor Juan Carlos selbst davon wusste. Seine Schwester ist Ärztin und hatte hin und wieder Nachtdienst in der Notaufnahmestation. Eines Tages sagte sie ihm, dass sie manchmal in der Mitte einer sehr schwierigen Nacht in ihrer Pause ein paar Minuten vor dem Computer sitzen würde, um sich zu entspannen. Dann würde sie seine Fotos anschauen, da diese ihr ein wunderbares Gefühl von Ruhe und Friedlichkeit vermittelten. Und so enstand die Foto-Serie.
Im Laufe der Zeit merkte er, dass dieses Gefühl der Ruhe besonders intensiv war, wenn die fotografierten Leute lasen oder in Gedanken versunken waren. Manche der Fotos entstanden so auch zufällig. In anderen Fällen fragte er um Erlaubnis, woraufhin die meisten nur nickten und weiterlasen.

Solange die Menschen auf Papier gedruckte Bücher auf der Straße lesen, wird er die Foto-Serie immer weiter ergänzen. Daher ist es sehr passend, dass die Ausstellung in einer Bibliothek stattfindet.



Sunday 15 June 2014

Building in Käthe-Kollwitz-Straße


I took a photo of a building in the Käthe-Kollwitz_Straße in Leipzig two years ago. Recently I spent a couple of days in Leipzig and saw the building is in much better shape, so I took another photo. For some strange reason, the alignment between the two photos was way beyond my expectations, so I did a transition video with the before and after (mental note to self, take a third photo some time in the future).

Wednesday 4 June 2014

Spirit of Berlin


One of the advantages of being there vey early on the first day was that there were no queues, plus I had the luxury of spending some time talking to the soldiers. They told me that this C-17, named the Spirit of Berlin, is stationed in South Carolina, which is a long long way from Berlin.
When I was a kid I went to an open day door at Air Base Torrejón, close to Madrid. I can still remember how huge a similar aircraft looks like when entering through the rear ramp for a child. At the time, I think it was a C-5 Galaxy.



Saturday 24 May 2014

Close look at A400M


When I first moved to Germany, the plan was that I would work on the TP400 project (the turboprop engine designed by a joint venture of european companies powering the A400M). As life has many turns, I ended up doing relatively little on this engine, but even so it was quite special to have a look inside and even sit in the cockpit for a little while. I also spent some time talking to one of the French pilots, which made for an even better experience. Merci beaucoup!

Wednesday 21 May 2014

Food for the aero soul


I was yesterday a few hours at ILA and I really enjoyed the time. I arrived very early and managed to see most of what I wanted to see before it got too crowded, i.e. no queues! 

This is one of our engines, a BR710, proudly powering a beatiful Bombardier Global 5000.

More TK...

Friday 16 May 2014

AdH


It´s interesting to see how places change, and even more how our perception of these places change.

Tuesday 13 May 2014

Domus Artis


Most of the photos in the Serenity series have been taken while the person was engrossed in reading. Or at least I asked for permission if it was impossible to get close unnoticed. Not this one though, this is a fully staged photo, which is quite unusual for me. I wanted to take a photo of Juan Alfonso in his great exhibition space, Domus Artis, and this is what I came up with making use of the big opening in the roof (plus a little bit of help of an off-camera flash).

Casi todas las fotos de la serie Serenity las he tomado mientras que la persona estaba absorta en la lectura, o al menos he preguntado antes si era imposible acercarse sin ser visto. Menos ésta. Quería hacer una foto de Juan Alfonso en su maravillosa sala de exposiciones, Domus Artis. Y viendo la luz que entraba por la ventana, esto es lo que se me ocurrió en ese instante. Para destacar un poco más la cara usé un flash a la izquierda de la cámara.

Friday 2 May 2014

Serenity in the park


While walking around the village looking for some more portraits of people, I spotted this young lady reading in the very same park where we used to play many years ago. I came closer to ask for permission to take a photo for the Serenity series and I was surprised to see that she was reading an English book.

Even better, this was not the only photo I will be able to add to my exhibition in July here in Berlin, as shortly afterwards I managed to take yet another one.

Sunday 27 April 2014

Peluquería antigua


La semana pasada estuve de nuevo en El Toboso para pasar unos días de vacaciones. Una visita a una peluquería antigua dio paso a una conversación con el peluquero y a un par de retratos. Yo, que casi nunca hago fotos de extraños, me pasé de repente dos días arriba y abajo haciendo retratos de gente en sus puestos de trabajo. O en la calle. Las típicas fotos de aquí te pillo aquí te mato. Y casi todo el mundo accedió a posar con una gran sonrisa.

Tengo suficientes fotos para hacer una exposición. Son unos treinta retratos de gente variada que me encontré en dos días intensos, en los que tuve que explicar una y otra vez que era nieto de Enrique el músico y biznieto de Brígida la partera, exactamente como cuando era pequeño y mi abuela nos mandaba a hacer recados a las tiendas del pueblo...

Last week I spent some days in my mother´s place of birth, El Toboso. A visit to the hairdresser´s triggered a series of portraits of people from this lovely village. I don´t take portraits of strangers very often, and neither I am much of a street photographer, but there I was, spending the best of two days walking around, asking people for permission to take a photo of them at their workplace and, in some cases, literally entering their homes to take a couple of photos. Quite an experience and very much worth the effort. There is a very good chance that this ends up in an exhibition some time later in the year, as if the one planned in Summer here in Berlin is not enough. 

Saturday 22 March 2014

The Iron Man strategy to complete MOOCs


I would like to share a strategy which has worked very well with me for the last 15 months and allowed me to finish a considerable amount of MOOCs. I call it the Iron Man strategy and it is hard indeed. But very simple to explain. Don´t watch TV. Use the time instead to complete a MOOC, one at a time. And why is it called Iron Man strategy? Well, because you are only allowed to watch TV while doing the ironing! 

Saturday 8 February 2014

Winter break


I have not done panos for such a long time that I forgot to set the camera to manual. I was shooting with a fixed aperture and only later I noticed that the exposure times would be different (!). By then it was too late to get back and try again. Luckily the values were not too dissimilar and an acceptable result came out.

Wednesday 8 January 2014

Misunderstood - not

Estas navidades vi el anuncio de Apple, Misunderstood, y aunque no soy un gran fan de Apple, el anuncio me gustó, así que decidí hacer mi propia versión. Me he tirado todas las navidades haciendo mini videos y luego los he juntado todos en un video navideño. Simple pero resultón. Y claro, estos videos serán un tostón para todo el mundo, pero para la familia son un recuerdo entrañable con un esfuerzo moderado. No es el colmo de la creatividad, pero tampoco se trataba de eso.

Y tampoco es cuestión de meter el móvil hasta en la sopa a todas horas, pero con un poco de tacto se pueden captar los momentos estelares y los cotidianos. Yo me he limitado a secuencias de unos diez segundos, de las que luego entresaco los tres o cuatro segundos para cada secuencia del video. Finalmente he intercalado unas cuantas fotos, incluyendo unas cuantas del Whatsapp, un poquillo de música y ya está, la magia está servida.