19 Feb 2007

Flickr API - features and foibles

This week, I've been working on the flickr communications side of the Quakr Viewr app.

Semantically sensible
I've found the Flickr REST API fast, simple, and very well documented - incomparable to the befuddling eBay services docs I worked with last year.

The search API does wot it says on the tin. A GET Request for:

http://api.flickr.com/services/rest/
?method=flickr.photos.search
&api_key=[your key]
&tags=tin

, gives back a semantically sensible piece of XML metadata, with a list of elements named <photo>. By concatenating the bits in the right order, you can make the URLS of the photos themselves.

Cool things
Cool thing 1: &bbox=
The most exciting aspect of the Flickr API from our Quakr perspective is support for bounding box searches, meaning that we can give four geo:lat/long coordinates, and get back sets of photo metadata.

As a pedant, I must point out that, before the fanfare, Flickr already "supported" geotagging in that it supported whatevertagging - people were merrily adding geo:long=1234, and Flickr were letting people query it. What is new is that Flickr have started splitting the machine tag at the equals sign, treating 1234 as a number, stuffing it into some special database AS a number. Suddenly, they can do MATHS, and support COMPARISON operators, and presto, offer bounding box searching.

Cool thing 2: &extras=
The &extras optional parameter on a search causes extra metadata to be returned in the results. For Quakr, we're going to be using tags like ge:tilt for 5 of the 7 in our 7D metadata, so we need to get at these tags, and, for good user experience, to get at them quickly (ie, without making lots of extra requests.) extras=machine_tags is just the job.

Foibles
One or two features which confused me at first:

Foible 1: backdata
Geotags that were entered before the geotagging 'release' aren't imported into the special database. From the groups:

"# What about all the machine tags that are already in the Flickr database?
At the moment, they are still treated as plain old tags. We have plans to go back and re-import them as machine tags but for now, only new tags will be processed as machine tags."


The solution is given in the same post:
"In the meantime, if you re-save a machine from the 'edit this tag' page it will be re-imported as a machine tag."

Foible 2: 'limiting agent'
From the search docs:
"Geo queries require some sort of limiting agent in order to prevent the database from crying.
...If no limiting factor is passed we return only photos added in the last 12 hours (though we may extend the limit in the future)."


I solved this, following guyfisher's advice, with a
&min_taken_date=1970-01-01%252000%3A00%3A00
. (I'm OK with the start of time in viewr being the unix epoc...)

14 Feb 2007

Quakr presentation at XTech 2007

We, the Quakr gang will present our musings on Thursday 17th May at XTech 2007 in Paris, France.

Now... whether to have one of those presentations that consist of random colourful photos (creative commons, naturally), with just one word in white in the corner? Or is that just sooo 2005? Or, like flares, has it come around in a circle... ?

OK, I think what we'll do is put the viewr on autopilot on the screen behind us. I find walking through the floor and into the white void particularly vomitous.. perhaps we can set a record for mass induced motion-sickness...?

------
viewr:


13 Feb 2007

a place to stand

“GIVE ME A PLACE TO STAND AND I WILL MOVE THE EARTH” said Archimedes.

In thinking about moving the Quakr Viewr camera in a nice smoothish and less jumpy way, I suddenly hit upon what has been a philosophical problem for many years. In the Quakr Viewr world, there is no difference between moving the world and moving the camera. Imagine standing up from your seat - there is no way to satisfactorily differentiate between your head moving upwards and the world moving downwards. They both result in what your eyes see and the both result in what your mind perceives. It's only when we start thinking about everyone else who is standing up at the same time that the conclusion that the world is NOT moving but we ARE becomes the sensible one.

In Quakr Viewr I initially coded the camera to move when the user hits buttons or presses keys. When a user clicks on an image in view, selects an image from the drop-down list, or hits the previous or next buttons, the camera moves to the *best view* position for that image. Initially, it jumped to that position, but in the most recent release, it first jumps to look at the image and then moves smoothly through 20 iterations from it's current position to the aforementioned *best view* position. This is done by *simply* moving the camera, but I did investigate the possibility of moving the world. The two overly detailed reasons for this investigation were a) the sandy flash engine may work quicker with object moves instead of camera moves and b) there is more iterative move options available for object moves in the engine.

After much typing, testing and re-releasing, I found that there is no significant speed difference, but the complications of remembering where the world has been transformed to, and thus where it has to go next proved to be too much headache for me. The current release uses something Sandy Flash calls a *positionInterpolation* to control the camera position, and you'll notice that there is a bit of a jump before the movement starts as I flip what the camera is *looking at* (I'll be working on that if I find some spare time!). It's all good and here.

6 Feb 2007

newphotos - the old way

Following from our field trip with the 7D-Tiltometer, I took the liberty of taking a downsized version of each image and dummying up an XML file for them. With some very minor changes to the previously released beta αlphα, I now give you...
Quakr's New Photos rendered as ever in the Quakr Viewr1.

The updated XML file is here if you're interested. We are currently working on making the Quakr Viewr do it's thing in an interactive way, and this dummy version will provide us a reference point to see how well the active data looks compared to some hand coded stuff. Initial feedback on that release has been garnered and the majority of the items are to do with the default keyboard arrow usage. Some people want the left and right unshifted keys to turn the camera (as it does in this release). Other people want it to move the camera - like the shift left and right keys do. Nobody liked the first release which tilted the camera like the control left and right keys currently do. Is it subjective, or does anyone feel the same? Is this different feedback deserving of a *make your own keys* function? Watch this space for answers!

1 - the viewr is now in αlphα 2 release...

2 Feb 2007

related or relevant, 02/07

- RTI make X3D/WRL plugin for FF
here

- PSP video-ing
here

- alt.geotagging by uploading files...
here

-- more --

- taking two photos at once (possibly of interest...)
here

-- more --

- sandy just released version 1.2 of his ActionScript2 API. Time to implement and test...
here

-- more --

- an old, but interestingish reference to Flickr as an MMORPG
here

- geo greeting - buildings in gmaps as letters in a greeting. more related to flickr phrase prolly...
here (or childishly here)

-- more --

- a cheap as you like tilt switch...
here

-- more --

- halfbaked 1, a site for random ideas - a GPS Camera/Video
here

- halfbaked 2 - RFID mapped pictures
here

- halfbaked 3 - biometric camera
here

- halfbaked 4 - digital 3d camera
here

- halfbaked 5 - snapshots over time in same place to form time-lapse-film
here

- review of iCN 750
here

- a GPS device which can display and *take me to* geo info photos
here

- sony's GPS *for cameras*
here

- navpix - the site of images which is maybe able to speak to your iCN 750
here

-- more --

- Flux Player 2.0 and Flux Studio 2.0 - X3D/WRL Ff & IE Plugin and Tool.
FREE here

- This is a list of projects that CCG is interested in having done. "(uroc,8903) Wearable pan/tilt/zoom camera"
here

- www.robots.ox.ac.uk - 3d model from 2d image
here

1 Feb 2007

Thats beta, but still αlphα

Following some excellent feedback, discussion, meetings and the like, some work has been done! I am very proud to announce the official release of the Flash version of the aforementioned αlphα Quakr Viewr [http://www.mainem.co.uk/quakr/release_alpha_flash/]. It works like a dream, utilises your keyboard arrow keys for movement so you don't have to click on the navigation buttons. It allows you to click on the images you want to examine and it'll jump in and look at them. A list of enhancements will make it even better than it is, and feel free to comment with anything that you think it needs.

screengrab of Viewr

Some further detail...
o) Instead of reading a .WRL file, it reads an XML file.
o) It utilises the Sandy Flash 3D engine for the main window.
o) It allows image selection by two means - selecting the image in the scene or picking from the drop down.
o) It allows movement by two means - arrow keys and some control or shift or buttons in left hand side.
o) It currently render local images onto the scene, but will have to start getting external images.
o) The mechanics of getting the image list from google/flickr is being worked on.
o) erm... oh yeah, you need Flash 8 plugged in.