Saturday, March 20, 2010

Wishlist of Fictional Books

The latest dresdencodak reminded me that I need to make a list of fictional texts that I want copies of:

Sunday, March 7, 2010

Code that other people might use

Since I got the DSLR, one of my big practical complaints is the lack of digital zoom; of course, I'd prefer the equivalent optical zoom, but I'm not going for lenses that need their own tripods and cost more than a car... the complaint is simpler than that: I do all of my framing and composition in the camera, I don't modify pictures coming off the camera; maybe someday, but for now I actually find the "untouched digital negative" model appealing. (Also I spend enough extra time on sorting and captioning as it is, I don't *need* more work in my workflow, and my audience hasn't had specific complaints in any case...) This means that even at maximum (250mm) zoom, I'm getting useful pictures with huge excesses of whitespace (in the typesetting sense - sky, irrelevant shrubbery, etc.)

The normal approach would be to add a cropping step... but I'm using kphotoalbum, and it doesn't have one (it also buys into the "don't touch your originals" model, and I love it for tagging, so it's a good fit; it's just that it's purely for tagging/captioning/filing and doesn't have a slot for picture-modifying/deriving workflow extensions.)

I started sketching out the pieces involved, and when I got to the "UI" part, I realized I'd considered this before - that I wanted a feature like this in flickr itself. flickr already has a "notes" feature (drag out a rectangle, associate some text with it) and a rich and reasonably well documented API...

This brings us to my project of the last two days: auto_cropr looks at your recent pictures for ones with "cropr_me" tags on them (usefully, adding such a tag seems to make the picture newly recent.) Then it looks for a note (by the album owner only) with the text "cropr_me" (it would accept blank notes too, but flickr doesn't actually let you create those, and I want to match *some* string just to avoid stomping on other tags or generating lots of unintended clips - or for that matter, to allow a picture with a clip-note to have other notes too.) Given the note, it downloads the "Original", transforms the note into the appropriate coordinate space, uses PIL to clip out the rectangle, then uploads that back, with duplicate tags, map location, and date-taken... and then rewrites the original note to point to the clip (and points the caption back at the original picture.) Here's an example.

The tool is by no means complete - it's just reached the point where it works on my own live data, and solves the problem I started with. Things missing include

  • copying explicit permissions
  • copying "safety" level
  • putting EXIF/JFIF metadata/thumbnail in the cropped image
  • handling rotation (not hard, I just haven't had a real case where I needed it)
  • support for operating on someone else's album (mostly a matter of parameterizing the auth token/auth "frob" parts more than I've needed to - flickr's API is good for that)
  • coming up with a way for other people to use it - either as a packaged commandline tool, or a real "service" that you can sign up for on a web page.

Other than rotation, I don't need the rest of these for my use; I'd need to start asking around and see if anyone else actually wants the feature before setting up the rest (in theory I could use it as a chance to work through how to build flickr apps that other people can use - in practice, I don't actually have even a second app in mind, unless I go down the "back up all of your cloud services for you" path, and that's got a rather different structure.)

Not that I've told anyone about this blog, but I should start asking somewhere, so this will do: if this interests you, let me know (in comments here, or via the usual social networking paths.)

ps. It also needs a better name - it's not actually doing automatic cropping, in the sense of stripping excess "empty" space and applying rule-of-thirds heuristics or something like that, merely automated cropping.

Monday, March 1, 2010

tiny little robot army

(Yet another client: kblogger crashes on config under Karmic, but "bilbo" (now called "blogilo") seems to have a useful feature set and working autoconfig - entity quoting in titles seems wrong, but it gets a spin...)

As mentioned, I'm working my way through "Learning Computing with Robots", using the accompanying Scribbler/Fluke bot/bluetooth combo. The first chapter ends with a set of exercises, the first six of which are essay questions; while I don't have a grader, essay writing isn't that far from blogging, so I worked through them... and it was actually worth the time, it got me to actually think through some basic assumptions. Maybe later on I'll actually start blog posts off of them, either on general robotics or as a review of the textbook.

In the meantime, I spent the afternoon doing actual robotics - replacing the bump sensors on my Roomba. Mostly tedious mechanical work (20+ screws and some pressure-fit plastic - they're not *quite* far enough along to be entirely non-servicable, but they're not particularly designed-for-repair either. At least manufacturing evolution puts pressure on having most of the screws be the same kind :-) and a little soldering; I just swapped in the parts themselves, rather than repair them. This article had good detail on the specific steps, and this one had a useful set of pictures with screw locations and such (for a cliff sensor repair, but the initial steps are the same.) I like hands-on work, it's a good contrast to the time I spend in front of ASCII characters...