< June 2007 >
SuMoTuWeThFrSa
      1 2
3 4 5 6 7 8 9
10111213141516
17181920212223
24252627282930
Mon, 18 Jun 2007:

As much as I'd like to pretend to be one, I'm not a real photographer. Photographs are secondary to the experience - travel, laughter, people and memories. But sometimes I do give in and take a photo which requires patience, time and often, post-processing. Saturday night, I decided to prepare, polish and publish one of those.

Basic Tools: For stitching images the workflow involves three tools Hugin, autopano-sift and Enblend. All these tools are available with most popular distributions - apt-get install should do just fine.

The input to the tools are six photos taken with my trusty SD450. They have been taken with nearly identical modes with a Manual setting to prevent the camera from adjusting between pictures (forgot to turn off auto white-balance for this set). The camera has a panorama mode which allows me to fairly accurately align multiple pictures with enough overlap, but that's not really as useful as you might think.

Autopano: First step in creating panoramas is to identify common points. Autopano is an automatic image analysis tool which can identify common areas between photos. The command autopanog should get you the UI required to load all the photos. Other than checking absolute paths, there is nothing else that I found useful to tweak there. Autopano after computation throws out a .pto file which is then pushed onto the next tool.

Hugin: Hugin does all the further magic. After loading in the PTO file, select the image required to be the anchor or reference image of the panorama and anchor that image for position. It does really help if the horizon is horizontal for that picture. Thankfully, Hugin can actually read the EXIF data from the images to obtain information about the lens, field of view and other details which I wouldn't know how to provide. The next tab shows the data gathered by autopano in an editable view, to adjust the control points if required.

Rather than waste much time there, head over to the next tab and click on Optimize now!. It should result in Hugin working most of its miracles, in mysterious ways to perform, by realigning shearing and doing all the other important things required. About time, we got a preview of whatever is going to be the result. One of the curious behavioural defects of the tool is that the preview does not update unless manually initiated. I've wondered a couple of times about why the picture looks exactly the same whatever I do. But here's how it looks right now.

As it is very obvious, the camera's vignetting comes into play for the corners of all the images. Merely placing the layers above each other will not produce a satisfactory panorama. Therefore, rather than combine images inside Hugin, the output from this phase has to be the correspondingly distorted seperate images. So in the last tab, calculate the field of view, the optimal size and select the "Multiple TIFF" (cropped) output option. This gives us individual images which look somewhat like these (hmm... my ICC settings are off in these screenshots).

Enblend: Enblend does exactly what its name suggests. It can blend between images, performing a smooth transition between the frames to create a good looking panorama. Merely pass in all the images in order via the command like to enblend and it does the job neatly (but watch your CPU load). The blended image is not equirectilinear and requires cropping to create a rectangular image. Mine threw out a whoppingly large 161 MB uncompressed TIFF (12335x3438) file. After scaling it down, converting to JPG and re-inserting EXIF data, the image is ready for the world to see.

And that's the way it's done - only five months too late :)

--
Just because you can explain it doesn't mean it's not still a miracle.
                          -- Terry Pratchett, Small Gods

posted at: 09:11 | path: /tutorials | permalink | Tags: , ,

As Friday wound down, my sore body was resigning itself to a weekend to be spent mainly in bed. But what to feed the beast that roams within ? Out I went to Strand, to hunt for something cerebral, to stimulate thought and induce sleep (when consumed in excessive doses). An unsuccessful hour later, I emerged carrying a copy of Games Indians Play.

Somehow in the back of my mind, I was expecting an Indian re-run of Games People Play. But maybe I was setting the bar too high. The book begins rather uncomfortably, by stating a few prerequisites, right from the depths of disillusionment.

There are three points that the readers must be ready to acknowledge
as prerequisites: 

one, that there is indeed something wrong with us;

two, that there are aspects that do not seem to sit well in modern
civilized society; 

and three, that merely because other modern and civilized societies, 
also suffer from many ills, it does not make our own ills more 
acceptable.

Indeed, the book does tend to critique at a rather personal level than would be necessary. The following four chapters were a visible re-hash of nearly all literature on the subject in the last forty years. The basic systems by which selfish individuals coalesce into a mesh of cooperation explained by game theory principles. For someone who's been on Axelrod for two years, it hardly holds any interest. Except for one particular analogy.

Both India and Pakistan argue exactly as the two prisoners cited in the 
prisoner's dillemma, and arrive the 'rational and well reasoned' decision
to go nuclear - to defect - resulting in the two countries forgoing
the opportunity to save millions of rupees which could have been used
[better].

The book somewhat redeems itself, by then attacking the concept of fairness. Reading through it, I somehow seemed to recall the famed lines from Animal Farm - All animals are equal, but some animals are more equal than others. But it rather rambles along into the lack of self-regulation and the inherent disregard for others doing the same (as lunatech keeps saying: lesson #1: the universe isn't fair). Eventually to come to rest at the way Indians measure the importance of a person - purely by how many rules he can bend.

But to fulfil its initial promises, it hasn't gone far enough into the depth of the issue. Rather than discuss selection pressures which reward the behaviour that we observe, it merely presents the facts and leaves a rather dissapointed reader behind. And while the book doesn't even try to tackle the vast agrarian belt of India - it still does not understand that there's more of sub-urban India outside the big cities and inside houses. For something like the state of Kerala - a middle class majority, left-leaning socialist governments and high literacy rates seem to have alleviated at least some of the ills mentioned.

Rather than a cutting root cause analysis of the systemic problems that exist, the book seems to be written in half-disgust about the myopia of present day urban India, with game theory to back it up. Not to disagree with some of his conclusions, but the linking logic seems to from real life into game theory rather than the other way around - leaving me nothing to test his theories with. And there is just a subtle hint of silent reverence towards occidental cultures - a completely apples to oranges comparison (you eat both, right ?). The author desperately needs to read The Human Zoo, before judging the Indian concrete jungles by theories transplanted from university towns (Ithaca or wherever).

In one short phrase, the book talks more about "How/What we are ?" than rationalizing it with Why ? - an outsider's objective analysis which puts you (if you were Indian) in the same frame of mind as the emperor with the new clothes.

Along with this, I'd also picked up Just Wait Till You Have Children of Your Own!. Drains me of all bitterness, that book does. :)

--
The end of the human race will be that it will eventually die of civilization.
                -- Ralph Waldo Emerson

posted at: 06:48 | path: /books | permalink | Tags: ,