Thursday, March 10, 2011

Dragged Into the Future

Not a Technophobe!

I'm really not a technophobe. I build my own desktop computers, run Linux on them, and as a consumer, I've got an iPod touch. But when old stuff continues to work well, there are times when I can't justify replacing it with new stuff.

Cellphones are a case in point. In 1999 I bought phones for us; they were dual-band, which back then meant they worked on both analog and digital (CDMA for Sprint) networks. We aren't heavy cellphone users, but they were good for long-distance calls (minutes included), and toting around for emergencies, including the rental car flat tire in Chattanooga. It would be fun to have a smart phone, and I can envision trying my hand on a small app for Android, but I can't abide the expensive voice plus data plans that the cellular carriers mandate for those devices. I'd use the features of a smart phone just a few times a year, and when I'm within range of a WiFi signal, the iPod touch can do email and web browsing. So when I replaced my StarTac last August, I picked T-Mobile's pay by the day plan and an $80 phone. The Samsung T-369 has a camera, slide-out keyboard, and other features, and best of all, with pay by the day, I'm spending about $100/year as opposed to $320/year on Sprint, even though that was still a good deal compared to most current plans.

Change Notice

But sometimes change is thrust upon us. Our current TVs, VCRs, and new Magnavox DVR have been working well, despite the fact that most of this equipment is between 5 and 23 years old. The main television is a classic 35" from 1987 that is still going strong.

Like King Canute, I know that many things are beyond my control. However, not only are all things impermanent,
we have no control over the schedule. A letter arrived in late February which shows that the digital tide is lapping at my feet: Wide Open West (WOW) is converting their analog Basic Cable channels to digital in three phases (March, April, May). All analog equipment will require a digital to analog converter, or DTA (digital terminal adapter), to be rented from WOW, in order to function. (The local stations will continue to be available in analog, but anything you think of when you hear the words "cable TV" will not be.)

The Dilemma

The first words out of my mouth were "Oh no." With three analog TVs, three VCRs, and one DVR, disruption was inevitable. As the family technologist, it's up to me to find an acceptable solution. So what are the problems with the DTA solution?
  • the VCRs can no longer switch between channels automatically; someone must stand there with the remote for the adapter.
  • the DVR, even though it has a digital tuner, must rely on the adapter for Basic Cable because the digital signal will be encrypted, whereas analog is not.
  • Multiple DTAs are needed -- I ordered four on Feb. 25th -- each with a power wall-wart that must be plugged in, and a remote to operate it. Talk about clutter!
You may wonder why we have three VCRs. We do a lot of time-shifting, to record while we're away and to avoid commercials, and we've done it for a long time. There's a VCR for the main TV, a VCR we inherited as part of a TV/VCR combo from Joan's mother, which is handy when recording schedules conflict, and a VCR for the basement.

For the basement? We ride our bicycles on rollers in the basement year round, and especially in winter, so that we aren't painfully starting from zero fitness every spring. Riding your bike for 45 minutes or so while staring at the wall is a superlative definition for boring; so for years we've taped movies on an upstairs VCR and carried the tapes down to the basement.

Here is a peek at the video setup in basement, where we ride the rollers.

The Conversation

All of the above I derived from previous knowledge, Mr. Google, and the WOW "Buzz" blog (now defunct). Now it was time to call WOW and speak to a Customer Service Representative (CSR) to clear up details and see what suggestions or alternatives WOW could offer. I called WOW on Feb. 28th, and it went something like this:
Me: I explained my situation with the VCRs.
CSR: Yes.
Me: [after a pause] I asked what WOW was doing for people in this situation.
CSR: [Chuckle] Wide Open West won't do anything for you.
Me:  Well, then, what do you suggest that I do?
CSR: The only thing you can do is upgrade to WOW Digital Cable and our DVR.
Me: How much would that cost? And won't I be on digital service anyway, because my basic cable will be digital after this transition? Won't I just need the DVR?
CSR: No, you have to sign up for Digital Cable. That's just the way the equipment works.Your Basic Cable is analog now, you see, but that's going away because of the FCC mandate.
Me: [rolling my eyes] This is an FCC mandate rather than a business decision?
CSR: Yes, the FCC has ordered that analog service is going away. It's not Wide Open West's decision.    
Me: [skeptically] Uh-huh. Well, will you please tell me what the Digital Service and DVR costs?
CSR: I haven't had a chance because you've been interrupting with all these questions.
Me: [losing my composure] So it's my fault?
CSR: It's nobody's fault ... the Digital Value Service and a DVR would be an extra $15/month.
Me: I see. Also, I was wondering, can you tell me how to test my digital adapters before the conversion takes place?
CSR: Tune it to one of the channels. The basic cable channels are 11-13 and 23-99.
Me: OK, but I'd like to test the digital adapters before the basic cable channels become digital.
CSR: All you have to do is tune it to a basic cable channel, like 44.
Me: [giving up] OK, thank you, I guess that's all the questions I have for today.
There are two points to make right away. First, the conversion is strictly a WOW business decision, to free up bandwidth for more digital channels, more HD channels, and faster Internet service (we'll see). There is no FCC mandate except the for cessation of over-the-air analog broadcasting a year and a half ago. WOW confirmed this on their own blog.

The second point is that WOW's DVR is an odd beast. Yes, it has two tuners, so you can record conflicting or overlapping programs. On the other hand, they advertise up to 50 hours of recording time, whereas my single-tuner $250 Magnavox DVR has up to 620 hours of recording time. The phrase "up to" means how much a device can record at lowest quality/highest compression; at highest quality, my DVR can record 103 hours, a 1:6 ratio compared to the "up to" number. If I apply that ratio to the WOW DVR, I calculate an abysmal, difficult to believe, 8 hours at the highest quality setting! Plus, as with almost all cable company DVRs, the user interface is considered extremely clunky.

So at $180/year, plus tax, I'm not seizing on the WOW solution of Digital Cable plus WOW DVR. Although it is more trouble than we encounter now, I'll start with the DTAs and see how it works out. With up to four recording devices, we can record up to four no, three (see below) different Basic Cable channels while we are away, even if each device is locked into one channel. Fortunately, at least half of our viewing is on the broadcast channels.

The DTAs arrive, with a Surprise

Yesterday, March 7th, the four DTAs were delivered. Each is in a slick box.
Inside, the contents, including the DTA itself, a remote (infrared) plus 2 AAA batteries, an IR (infrared) extender (in case you don't want the DTA to be visible), coax cable, wall-wart and power cord, and a small bit of adhesive velcro.
The DTA itself is petite.
All the connections are on the back. There is no power button, it is always on, unless unplugged. Each DTA draws about 4 watts and is warm (not hot) to the touch.
The remote is blessedly uncomplicated.
Connecting the DTAs was straightforward: cable in, cable out, set the switch to Channel 3 (Channel 4 is a real channel here). When each DTA was powered up it would search for cable service and not find any (per status messages on channel 3). An activation is needed; armed with my WOW account number I went to the activation web site, when all DTAs were connected and powered up, and clicked on Activate. Within 15 seconds, the TVs had a signal!

But ... but ... I discovered that the DTAs do not have pass-through. That is, the channel that they forward to your TV or recording device on channel 3 is the *only* signal that they forward. My VCRs and the DVR all have pass-through; that is, although they tune in a single channel to record, they also have one output that is the original, untainted cable signal with all the channels. This is how they can record one channel while you watch TV on another channel: switch the TV to the pass-through signal, and all the channels are available to the TV as if the VCR/DVR wasn't there.

The DTA doesn't do that. Not even for the local broadcast channels.

Well, that shoots a gaping hole in the usefulness of the DVR, so I removed the DTA from the DVR input. It is imperative that unattended recording of the broadcast channels can take place. What about the basic cable channels? When they are converted to encrypted digital, the DVR, having no DTA, won't be able to decipher them. The DVR will be dedicated to broadcast channels, and the VCRs, each with a DTA, must pick up the slack and be used for basic cable channels. Joan and I will have to post a channel-switching schedule so we don't forget to re-tune the DTA for the next basic cable channel that we want to record. Perhaps we can dedicate one or two of the VCRs to a particular channel, but we certainly can't have one VCR per channel. It turns out that we are extremely fortunate to have multiple VCRs!

Side note: WOW states that they are contractually obligated by the content providers to encrypt any digital signals, supposedly to reduce piracy, except for the local broadcast channels, which are available in unencrypted digital, technically called "clear QAM." My DVR can and does tune in the clear QAM channels -- but it cannot if the DTA is on the line.

And here's our new remote lineup: DVR, VCR, TV, and DTA remotes.
To be fair, the DTA remote can, with a few minutes effort, be instructed on which TV code to use. It then can control the TV's on/off and volume/mute, and it perforce also controls the channel. So the most common uses of the TV remote can be done with the DTA remote.

And Now ...

... the DTAs are installed, and we're waiting for the three transition dates, March 28, April 25, May 23, hoping that there will be no further upsets. Because there is semi-official word that a whole-house DVR is in the works for WOW, we're hoping for good news later this year. With a whole-house DVR, recording on VCR tapes might no longer be needed. (There will still be lots of existing tapes to play back, including a library of the "top 100" movies that my father taped for us a few years ago.)

What would I say that WOW did well in my experiences so far?
  • the digital converters are inexpensive (first two free until Jan. 2013, others $2/month)
  • the digital converters install easily and activate quickly 

What would I say that WOW could have done better?
  • more advance warning. Our neighbors, for instance, who were out of town when the letters arrived, had three weeks notice before the first conversion.
  • a more sympathetic (or at least congenial) and, especially, better informed customer service representative.
  • an optional (even at higher cost) DTA that offered pass-through capability.
  • delay the conversion until the WOW whole-house DVR is available. (I realize this one is reaching for the sky.)
  • Make technical information easily available for those of us in charge of technology planning for a household. A web page with more info on the DTAs and on the clear QAM channels would be most helpful, guys!
Somehow the cable companies always manage to give the appearance of overlooking their basic cable customers. This may be a side effect of the race to compete for big dollar customers that want movies on demand and such, but it's unfortunate and discouraging. I will say that, from my research, Wide Open West does on average appear to be doing better than most others in their customer service. It's not just my opinion, check out the ratings on pages 26-27 of the February 2010 Consumer Reports. But there have been some omissions and missteps in the initial rollout of the digital conversion; I have my fingers crossed that the actual switchover will be smooth and uneventful.

So I've been dragged a mile down the road into the future. We hope there are no more ruts, potholes, or washed out bridges before we reach the next stable technological ecosystem. Our salvation will be if the whole-house DVR can liberate us from both VCR recording and DTAs at a reasonable cost.

Maybe we'll even replace our almost 24-year-old TV this year. After the dust settles.

Friday, March 4, 2011

Relaxed Owl

It must be a good neighborhood; the barred owls returned and are nesting in the nearby tree cavity. This is the third spring for them here.

Two days ago, we did some tree trimming which was mostly aimed at improving the visibility of the owl tree from our living room. Last year it had been greatly obscured once the leaves came out. One of the owls was sunning in a pine tree at the edge of our neighbor's yard, quite disinterested in us even though we were working not twelve feet away from the nest tree. Eventually, as we cut the big pieces we had lopped off into little ones, the owl flew to the edge of the nest cavity, facing inward. It remained there for a couple of minutes, once sticking its head deep inside, and then it entered. It was a privilege to watch, and reassuring that we terrestrial creatures (too big for prey) were no cause any concern.

I have no pictures from that day, but the next day an owl was sunning and dozing in the pine tree again. It is a superior roost because it is close to the nest tree, so any threat could be driven away. Also, the pine provides sufficient cover that the crows and blue jays who insist on pestering and harassing the owl can't reach it.

At first, the owl would not face me.
Once, when I stepped on a stick, the owl checked out the noise for about ten seconds.
But mostly it was lightly dozing, calmly providing security for the nest tree.
We hope we are fortunate enough to have sightings of the hatchlings this year.

Monday, February 28, 2011

bATT LOW SEE MANUAL

My 2011 Honda Odyssey, Sam (named after Samuel Clemens, Samwise Gamgee, and Samantha Stewart, a character in Foyle's War) has been a big step up from my 1996 Plymouth Voyager. They're both 6-cylinder minivans, but the 2011 Odyssey is larger, more powerful, and gets much better highway MPG. (If the Odyssey were any larger, I'd need to remodel my garage after the Tardis -- larger on the inside than the outside.) There are plenty of gadgets and interfaces as well, but that's not the point of this short post.

All first-year redesigns have teething problems. Consumer Reports advises against buying freshman models for this very reason. In my case, and many others commiserating on the web, there is an annoying problem with the battery management system (BMS).

Mind you, I've never had a car before that would warn me when the battery was getting low. The first symptom would either be a hesitant engine start, or the dreaded machine gun click-click-click of an exhausted battery. So I'm not against a battery management system! But this one has a hair-trigger, and you can't ignore it. It's not a meek idiot light, so thank goodness it doesn't go on forever.
You can imagine how startled I was the first time that warning flashed! I took Sam to the dealer on Jan. 19th, who checked the battery (nothing wrong), cleaned and tightened the negative terminal, and cleared the error. Blessed silence ensued for the next 2½ weeks; then, the warning returned.

A simple Google search revealed that I was not alone, and that most with this symptom did not have real battery problems. We speculate that it's an issue with the sensitivity or monitoring mechanism or programming of the BMS. I took Sam into the dealer again, who told me that they had just been informed by Honda to "inspect" any Odyssey reporting this problem. Sam's work ticket from Feb 9th states,
Called Tech line, sent me a fax of a questionaire to fill out, looked up specs with HDS, hooked up GR8 and ran diag on battery, unplugged connector on battery, faxed all papers to ahm.honda.com.
So Honda is collecting engineering data. Meanwhile, I must be patient while waiting for a fix. Today, on schedule, about 2½ weeks after the last reset, the dreaded bATT LOW has returned.
 I'm hopeful that as the weather warms up the BMS will be less twitchy.

Update 04/29/2011

Today I received two notices from Honda. Neither one of them is regarding the Battery Management System.

The first is a Product Update for the audio unit software addressing a software bug that can affect the clock, radio, and HandsFreeLink. I haven't noticed anything in this area. The update is low-key: the letter mentions scheduling is as part of your 'next planned service appointment.'

The second is an Important Safety Recall Notice for the front windshield wiper arms. They're too flimsy. If the blades are frozen to the windshield and you turn on the wipers, the arms may bend or separate!

I'm still waiting for any word on the Battery Management System. Since I took a long road trip in March, and the weather warmed up, I haven't seen the problem again. Left unresolved, I'm sure it will show up again next winter.

Update 05/19/2011

It's baaaack! After being away for 15 days or so, I fired up Sam last evening, and got the bATT LOW message. Perhaps a little freeway driving and a warmup (it has been chilly this week) will help, at least temporarily.

Update 12/17/2011

Honda has finally released a TSB (Technical Service Bulletin) for a product update on this issue! Hurray!

Honda TSB 11-073 - Product Update: MID Shows BATTERY CHARGE LOW or bATT LOW 
Applies To: 2011 Odyssey – Check the iN VIN status for eligibility 
BACKGROUND
The battery sensor software update improves the accuracy in warning customers when the battery’s state of charge is low by changing these inputs:
  • The sensor factors in the ambient temperature when calculating the current state of charge.
  • The sensor ignores short duration voltage drops, such as when the power sliding doors are opened.
A low battery message may still appear if the customer uses a system for an extended period of time with the engine off, such as playing a movie on the RES or planning a trip using the navigation system.
The new software will not improve vehicles with the following conditions:
  • The vehicle has a low battery because it’s not driven regularly or long enough to recharge the battery.
  • There is a high-current draw problem with the vehicle, such as a high parasitic draw caused by aftermarket accessories (alarms, video game systems, etc.). 
CUSTOMER NOTIFICATION
All owners of affected vehicles will be sent a notification of this product update.
Update 01/15/2013

I had the software update applied a month ago -- I waited a long time so that I could take it in at the same time as Sam's annual oil change. I'm pleased to report that I'm now free of the dreaded chimes!

Sunday, February 27, 2011

Who Designed This? Our Dishwasher Saga

This January our dishwasher died. We had been noticing an occasional whiff of hot plastic, off and on, but didn't locate it until the dishwasher fell into a coma in mid-cycle and wouldn't wake up again. It was time for one of our (least) favorite activities, appliance shopping. At least it wasn't Thanksgiving!

The unit, a Bosch, had already had two repairs in its 8½ years, so our first impulse was to cross Bosch off our list of candidates; however, Consumer Reports gives them an excellent rating on dishwasher repairs. Shopping at hhgregg, where we had a good experience a few years ago buying a washer/dryer, we narrowed our choices down to a Bosch or a KitchenAid. We went with the Bosch, and it was installed the next day.

The rubbery toe plate, not a part of the showroom display, looked odd. It stuck out a quarter-inch so along the whole length of the door. As Joan noted, it would funnel any drips or splashes (I am not a tidy cook) behind the kick plate, to linger and ferment. Ick.
It looks peculiar from the side as well, even if the gap exists to accommodate the rotation of the door. The slot on either end of the horizontal portion (not the metal kick plate with the screw) is a mystery.
Joan wrote an email to Bosch technical support asking why the plate stuck out further than the door. To its credit, Bosch responded within a day, asking for photos. We sent the two you see above, and Bosch's response was, "It's installed wrong."

hhgreg was swift when we contacted them, and sent an installer out on a Sunday. His first reaction was, "I've installed a hundred of them this way." We shared our Bosch correspondence with him, and he agreed that if it was an issue, it was an issue with more than just our one unit. He took our documentation back with him to hhgregg, reassuring us that if we weren't satisfied at any point, we could choose a different dishwasher.

Next, hhgregg notified us that a technician from Capital City, an independent service company, would be coming out to fix our unit. Two days later, he arrived and carefully disassembled the rubber and metal plates, and reassembled them, demonstrating that things only went one way.

Joan sent another email to Bosch, explaining the turn of events and asking for clarification. To this day we haven't heard from them. The design gods were silent.

We tried using the Bosch for a few days and found more design problems, at least for the way we use it. The tines on the bottom rack are held higher than the floor of the rack, shown in this photo:
The added height meant that our 11" dinner plates stood high enough to interfere with the rotating washer arm in all but a few positions. We later learned from Evan Coleman, our hhgregg sales rep, that Bosch claims this is to improve the water coverage of items in the lower rack. Perhaps the design gods are also coping with the unintended consequences of their hidden heating element (more vertical space consumed in the bottom of the unit)?

Another problem with the lower rack was that the tines were all tilted. This may help fit more plates in the available space, just as italic fonts fit more words in the same line, (holds 14 place settings!) but it frustrates someone who wishes to put pots, large mixing bowls, or food processor bowls -- anything with straight sides -- into the unit. It can be done, but it requires stubbornness. On your part, the tines are already so.
Designs change in waves of fashion or marketing, even among prosaic objects such as dishwashers. The design gods of every dishwasher we saw had decided to avoid complaints about wet stemware (think wine glasses); the geologic thrust fault you see below, adjacent to the side of the top rack, forces your stemware to tilt, from left to right, at least 30° off vertical to avoid the pooling of water.
Also, there's not much space left between the flip-down shelf and the crest of the ridge: perhaps 3¾" if I had held the tape measure completely vertical. Demitasse size at best.
Frustrated, we decided to go back to hhgregg and swap for something else. We were soon struggling to choose between two KitchenAid models, both of which were 2" deeper (holds 15 place settings!) than the Bosch, perhaps explaining why the Bosch was rated 2 decibels quieter. The more expensive of the two had a stainless steel facade instead of black (don't care, but it adds to the cost) and top-of-door controls instead of front-of-door (I suppose we could live with it), but it had the fold-down shelves for the top rack, and the less expensive unit did not.

Evan worked diligently with us. He researched whether the costlier model was available in black (no, not through hhgregg), whether we could separately order the upper rack (no), whether the shelf was available as a separate or replacement part (no, too new). He did bring the news that hhgregg would sell us that model for $100 off the floor price, and there would be an additional $60 MGR SAT (Manager Satisfaction?) discount. Plus, because there was a KitchenAid (mail-in) rebate on installation, we could switch to any KitchenAid without that expense. Our net cost to swap the Bosch for the higher KitchenAid would be $150. (We had an extended warranty, which we normally eschew, but because of our experience with the previous Bosch, we had purchased one. Part of the expense for the higher KitchenAid was a bump in the extended warranty.)

We went for it, and hhgregg made the swap the next day. (We do feel that we were treated very well at hhgregg and will shop there again.)

Here is the bottom rack of our new new dishwasher, with straight tines and enough vertical room for dinner plates.
You can't run away from the stemware fad,  also present on the KitchenAid models.
Although the height of the top shelf appears to be within 1/16 of an inch of the Bosch, our mugs and small glasses fit beneath the shelf! Perhaps because it's missing the scalloping on the underside, or, perhaps, the design gods deigned to smile on us just this once.

The new dishwasher isn't perfect; none could be, for that would leave the design gods with nothing more to do. It gulps Rinse-Aid like the desert in a rainstorm, and the instructions (p. 6) state, "Avoid overlapping items like bowls or plates that may trap food." But after our adventures, we're happy with the KitchenAid. Even the stainless steel front, an orphan design in our house, works, calmly reflecting the blues and whites of the kitchen floor.

And the rubber toe plate doesn't stick out. In fact, there isn't one.

Update 07/19/2011
Starting in early June, the new dishwasher started misbehaving. 4 times out of 5, when 'normal cycle' was selected, the unit would turn itself off partway through the job. If we selected '1 hour wash,' it would finish OK. It was still covered by KitchenAid's 1-year warranty, not even considering the extended warranty by hhgregg. 

The washer did not misbehave for the repairman last week, but my description -- even the status lights turning themselves off -- convinced him that there was a poor connection in the master controller to the power supply, one that would disconnect when it got hot. He installed a new master controller yesterday, so as soon as we have a load of dirty dishes, we'll see if that fixed it!

Thursday, February 17, 2011

My Photo Tweaks; assembling and disassembling video

A previous post discussed combining more than one image to generate a stronger single image (panoramic and High Dynamic Range photos). With the time-lapse movies and screen-capture clips of recent posts, I've been involved with a different alchemy, both assembling videos from a series of still images, and extracting still images from a video in order to tweak them.

Warning: this post lets my geek side spill out. I used free, open-source tools that allowed me to twiddle and tweak as long as I had the energy to research. I apologize to the majority of readers, for whom this has little interest. A non-technical post on an entirely different topic will be next up!

Time-Lapse Files
I copy the JPG files of the photos from the PlantCam to my computer. There, I first make a quick video with the ffmpeg command-line tool (more free software) to see what tweaks are needed. The JPG files are numbered sequentially, WSPC0001.JPG, WSPC0002.JPG, and so forth. (WSPC stands for WingScapes PlantCam). To make a video from the raw images, I just type:
ffmpeg -f image2 -i WSPC%04d.JPG -qmax 3 video.mov
This tells ffmpeg to assemble a video from the files with a name of WSPC followed by four digits, at a high quality/low compression level (-qmax 3). If I'm happy with the result, I'm done, but there are often frames that I would rather not include: my face peering into the camera to see if it's working, light flares from the sun when clouds part, frames that are too dark as the sun goes down, and so forth. Small numbers of these can be dealt with by deleting the individual frames, but a complication is that ffmpeg expects consecutive frame numbers, so if any frames are deleted, the video stops there! Renumbering is a must, and that is something you do not want to attempt by hand.

To avoid accidentally deleting the original images, I create a subdirectory, and run my scripts from there. A basic renumbering script looks like this (yes, you coders out there, there are many paths climbing this mountain):
let i=1
for file in ../WSPC*.JPG
do
    nname=`printf "fr-%04d.JPG" $i`
    cp $file $nname
    let i=i+1
done
This script creates a copy of the WSPC images in the current directory, with the same four-digit naming convention, but the numbers will be sequential even if I've zapped some of the original files.

What if you wish to do various operations, such as cropping, contrast adjustment, and so forth? You aren't going to tweak each frame with the GIMP ... there will be hundreds or thousands. Another free, open-source toolkit, ImageMagick, comes to the rescue with its command-line suite. We'll jump in with a script I wrote for the "snow day" time-lapse clip. It may appear intimidating but I'll go through it step-by-step. I don't claim that it's optimal, but it worked.
/bin/rm -f video.mpg fr*.JPG

for i in ../W*.JPG
do
    nname=`printf "fr-%04d.JPG" $ix`
    let ix=ix+1
    stamp=`identify -format "%[EXIF:DateTime] %w" $i`
    fdate=`echo $stamp | cut -f1 -d' ' | sed -e "s/:/\//g"`
    ftime=`echo $stamp | cut -f2 -d' '`
    fwide=`echo $stamp | cut -f3 -d' '`
    let fontsize=$fwide/25
    echo $i $fdate $ftime $fwide
    convert -contrast-stretch 0.30x0.35% -unsharp 3x1.5+0.36+.05 $i $nname

    # create a timestamp watermark.
    #
    convert -size ${fwide}x100 xc:transparent -font FreeMono-Medium -pointsize $fontsize \
            -gravity center -draw \
                "fill black text -1,-1 \"$fdate $ftime\" \
                 fill black text 1, 1 \"$fdate $ftime\" \
                 fill white text 0,0 \"$fdate $ftime\" " \
            stamp_fgnd.png

    # shrink size of the image to the contents (-trim) and change the virtual canvas to that
    # size (+repage), then add the watermark to the image.
    #
    mogrify -trim +repage stamp_fgnd.png
    composite -watermark 65.0 -gravity southwest -geometry +10+5 stamp_fgnd.png \
        ${nname} foo.jpg
    mv foo.jpg ${nname}
done

ffmpeg -f image2 -i fr-%04d.JPG -qmax 4 video.mpg
The first line of the script just removes the files from any previous run. Then, as before, for each WSPC JPG file, we create a proper sequential name. Next we use the identify tool from ImageMagick to extract information from the EXIF data kept in every modern digital image. In this case, we get the time and date that the image was taken, because I want to create a timestamp watermark, and the width of the image, to calculate how large a font to use for that watermark.

Next, we not only copy the original file into the subdirectory, but we modify it with the convert command. The '-contrast-stretch 0.30x0.35%' argument tells convert to stretch (increase) the contrast until no more than 0.30% of the pixels are completely dark, and no more than 0.35% of the pixels are completely bright. Then the '-unsharp 3x1.5+0.36+.05' argument applies an unsharp mask (to sharpen the image) with various values (mask radius, standard deviation, amount, and threshold). Contrast enhancement and sharpening were tasks I did by hand using the GIMP for single images, but here, they are automatically (and uniformly) applied to each frame. I spent a while experimenting with these values, re-running the script each time, until I reached a satisfactory result.

Next, convert is used to create a watermark file (stamp_fgnd.png) using the date and time extracted earlier. The text is drawn twice in black, once offset by one pixel to the left and above and then once to the right and below, before being drawn in white with zero offset. This makes a nice outlined text. A simple timestamp might look like this:
Not knowing how large the final text would be, the initial watermark canvas was made large (as wide as the image and 100 pixels tall) and the text placed in the center. This leaves a lot of empty space around the text, as you see above. Because I want to place this text in the lower left-hand corner of another image, I want to discard the extra space. The script uses the mogrify spell (basically a synonym for convert that writes the result directly into the original file rather than a second file) to slice away the extra (-trim):
What the above image doesn't show you is that the text and the canvas have both been trimmed, but the offset of the text hasn't been corrected. Many viewing programs automatically correct this for you, but the GIMP notices:
The two must be realigned in order for the watermark to show up as expected, so the '+repage' is also done. (Mogrify, like all ImageMagick commands, performs its magic from left to right, so in this case the trim is done before the repage.)

Finally, composite is summoned to combine the timestamp image and the original image. The timestamp is added as a watermark, with the original image contributing 65%. The addition takes place at the southwest corner, with an offset of 10 pixels in X and 5 pixels in Y. The result is written into a temporary file and then copied into the original filename. The result is pleasing, as this frame from the "snowy day" video shows.
One side note: for minimal processing of videos from my camera, such as cropping edges or clipping leading or trailing seconds, I use an ffmpeg incantation directly, rather than the painstaking work described in this post. One example: 
ffmpeg -i 00134.mov -sameq -croptop 160  -cropright 180 -acodec copy piper.mov
Screen Capture

In preparing the earlier posts I also used screen capture to reveal how a particular program works -- using xvidcap I grabbed videos of the GIMP and fotoxx in action. Being screen captures, these videos did not need any contrast enhancement or image sharpening; however, it is difficult to perform an example task without bobbling some aspect, even with practice, and if the task requires the computer to crunch away for 30 or 60 seconds, the video becomes boring. Very boring.

I needed to break the video into separate images, allowing me to delete my mistakes and distractions, and to compress the tedious parts. Fortunately, ffmpeg breaks apart a video quite handily:
ffmpeg -i test-0000.mpeg -qmax 2 -f image2 test-%04d.jpeg
This is exactly the reverse of assembling the video: the separate frames are created as individual, sequentially numbered JPG files. Then I can manually delete a small number of frames, or write a script to skip or speed up entire sections.

I also needed to make an extra copy of each frame to slow down the playback. With xvidcap and the demonstrated program (GIMP, fotoxx) competing for the computer, it was best to capture the desktop at no more than 12 or 13 frames/second. However, ffmpeg wants to produce video that plays at 25 frames/second. This mismatch spawns a hyperactive mouse that is difficult to follow. After losing several arguments with ffmpeg, I decided the easiest course was to double frames.

Here is another example script. It extracts the four-digit number from the name of the original frame, allowing it to process only every other frame between 1290 to 2064, and creating two copies of all the other frames. Thus, the waiting-for-the-computer section zips along four times faster than the moving-the-mouse parts. Finally, ffmpeg is used to assemble a video from the new frames. (I discovered that for screen capture, versus photographs, a different encoding standard, h264, produced smaller files.)
let ix=1
let skip=0

# create two copies of each frame, to make the pace of the playback reasonable
#
/bin/rm -f video.mpg fr*.jpg

for i in ../test*.jpeg
do
    if [ $skip -eq 1 ]
    then
        skip=0
        continue
    fi

    orignum=`echo $i | sed -e "s/..\/test-//" | sed -e "s/.jpeg//"`
    nname=`printf "fr-%04d.jpg" $ix`
    cp $i ${nname}
    let ix=ix+1

    # do not double the boring stretch, in fact, halve it!
    #
    if [ $orignum -gt 1290 ] && [ $orignum -lt 2064 ]
    then
        skip=1
        continue
    fi

    nname=`printf "fr-%04d.jpg" $ix`
    cp $i ${nname}
    let ix=ix+1
done

# reassemble the video using the libx264 video codec
#
ffmpeg -f image2 -i fr-%04d.jpg \
    -vcodec libx264 -vpre lossless_ultrafast -threads 0 video.mkv
The moon is setting, and it's time to wrap up this post and close our book of spells (or web sites with manual pages for command-line tools). Thank you for visiting the lab with me.

Friday, February 4, 2011

My Photo Tweaks; panoramas and HDR

Producing Panoramas

Hiking in scenic locations begs for extra-wide pictures that can't be taken in a single frame. Over the years I have used various tools for combining overlapping images; currently I use fotoxx for this task.

In the following screen capture you will see several steps:
  1. Choose the Panorama option.
  2. Pick two pictures for the panorama.
  3. Set the lens used for the pictures (mine was at 25mm).
  4. Position the images as closely as possible to the proper overlap.
  5. Click on proceed.
  6. Fotoxx highlights the parts it is working on in red.
  7. Skip the match brightness option.

Let's watch the clip.


It's best to set the lens value properly, because it will make aligning the photos much easier and more successful. A wide angle lens makes a square image out of a round view -- think of the 'fish eye' lens, which warps up to 360° of view into a rectangle. With the right lens value, fotoxx can restore the original curvature of view, making alignment of features in the two images practical or, in some cases, achievable at all. 

The photo I wanted on the left of the panorama was originally on the right of the workspace, so my first action was to drag it over until fotoxx swapped the images. Then, using a combination of drag and rotate, I did my best to align the overlap. When objects both at the top and at the bottom of the image are crisply superimposed, you've got the right mix of rotation and positioning. If things aren't working out well, you can try changing the lens value, which alters the degree of curvature, to compensate. (For purposes of shortening the demo I edited out several seconds of my fumbling about placing things.)

Fotoxx takes over after you click on 'Proceed.' It searches for the best match, tweaking your image rotation and position, and choosing which pixels to use in the overlap zone. It can take some time; for this demo, I cut out about ¾ of the frames to speed things up.

When fotoxx decides it has done all it can do, the Match Brightness panel pops up. With this, fotoxx can attempt to match the brightness levels of the component images to make the panorama as seamless as possible. Usually, when I have adjusted each image ahead of time as in the previous post, this isn't necessary.

When I'm satisifed with the panorama, I save it and do final processing with the GIMP. This is primarily doing any rotations needed to level the horizon, cropping out most of the black areas, and trimming the left and right sides. If the panorama, intended to be wide, is too wide, it becomes very short when squeezed into a browser. (Yes, I could also do these things with fotoxx, but I'm already familiar with the GIMP. There is a swarm of photo-editing tools to chose from, and no reason to master them all.)

Here is another photo-taking tip for panoramas. If you hold the camera steady and rotate your body to take the overlapping pictures, objects in the foreground are almost impossible to line up (superimpose). Their picture was taken with the camera in two different locations. For distant objects the shifting is negligible, but it can make you pull your hair out over objects from near to many yards away. I've given up on one or two panoramas where I was sloppy and stumbled over the parallax. It's best to keep the camera in the same position, and rotate it around center of its lens to take the overlapping photos.

High Dynamic Resolution (HDR)

What's HDR? Consider a scene with both deep shadows and bright surfaces or skies. Even with contrast tweaking, it can be impossible to produce an image that clearly shows detail within both the very dark and very bright parts. High Dynamic Resolution, which I have briefly experimented with, is taking two more more photos of the same image at different exposures, and using the best parts of each. To bring out the detail in very dark sections, use those parts of an otherwise overexposed image. To reveal the structure in very bright sections, use those parts of an otherwise underexposed image.

Fotoxx offers an HDR operation in the same menu as Panorama. There is no manual alignment; any adjustments are done by fotoxx. This requires that the two images are, except for the exposure, close to identical; otherwise, fotoxx can't figure out how to combine them. Ideally, your camera has the ability to take a series of photos at different exposures with one press of the button, while you hold the camera still (or deploy it on a tripod). Mine will take 3 shots, but across a limited range of exposure, and the demo that follows is from images taken before I remembered how to do even that!

The two originals do not align exactly but fotoxx eventually figures it out nonetheless. They are not different enough to make a striking improvement when combined with HDR, but there's enough change to demonstrate the principle.

Now let's watch the fotoxx HDR processing in action.

In the first several seconds you can see fotoxx working up a sweat aligning the two images as best it can. Eventually it finishes its work, and the Adjust Image Contribution panel pops up. This panel allows you to specify how much each image contributes to the combined result across the different brightnesses, by manipulating the lines (one for each original image) in a fashion similar to the Adjust Color Curves panel in the GIMP. The fotoxx documentation points out that by bringing out the detail in the dark and bright areas, you effectively decrease the contrast, and Adjust Image Contribution allows you to compensate for that, or to follow other artistic impulses.

When I first tried HDR I stumbled into an issue, motion. If flags are flapping, branches waving, or people walking, the images you combine are of course different. Ghosting or double-exposure will result. There may be techniques to manually correct the resulting image, but those experiments are in the future. Improving photos is a never-ending process!

Thursday, February 3, 2011

My Photo Tweaks; photo editing with the GIMP

If you've viewed other posts in this blog, you know that I rely heavily on photographs to convey impressions and to make the blog appealing. A discussion I had with Chris at Talus Lodge about post-processing of photographs, using pen and napkin, inspired me to put a blog post about photography on my to-do list. Now, five months later, I'm finally getting around to it. I hope you will find it interesting, particularly if, like me, you prefer to casually work with photos before displaying them.

Processing a single photograph is just the beginning, it turns out. Later posts will take a peek at combining photographs for a panorama, using multiple images for high dynamic range, assembling photographs into a video, and extracting images from a video.  I apologize in advance for any lack of clarity, excessive detail, or omitted points in these posts.

The first thing I do in editing an image is to crop the photo to either frame the scene better, or to zoom in on a feature of interest. After all, my current camera, a Panasonic Lumix ZS-3, can produce images that are 3648 pixels wide, whereas the pictures that I post to the blog are about 1000 pixels wide (there are still a lot of computer monitors out there that are only 1024 pixels across). There's plenty of room for cropping.

Because I am a big open-source fan -- my home PCs have been running Linux for at least a dozen years -- I use a program called the GIMP for photo processing. (GIMP stands for GNU Image Manipulation Program. GNU stands for GNU's Not Unix.) It is available for both Windows and Mac OS X as well as Linux. Here is a screen capture of a simple cropping operation using the GIMP.

Note: if the playback is too small to see well because of the width constraint of the blog, click on the full-screen icon on the far right of the playback bar. Depending on the resolution of your monitor, this may work better.


Once the image is cropped, I move on to enhancement with the Adjust Color Curves feature (from the Color menu, select Curves). The histogram, or distribution of pixels from darkest to lightest, is then presented:

In the above histogram, there are few if any extremely dark or extremely light pixels. (You can see a shade guide along the bottom, with darkest at the left and brightest at the right.) The 'Channel' selection allows you to manipulate just the red, green, or blue component of the image, or the overall brightness level, called value. To expand the range of the brightness level, aka improve contrast, I change the 'value' channel.

The histogram is from this low-contrast image:
The trick is to improve the contrast without going too far and creating garish or cartoon-like coloring. The Adjust Color Curves function allows you to manipulate the pixel distribution with great flexibility, more so than programs that sport a single 'contrast' adjustment or perhaps split the adjustment into predefined high-, medium- and low- (or shadow) tones.

Here is a demo of the mechanics of Adjust Color Curves. You use the mouse to alter the shape of the diagonal line that represents the mapping of the original brightness for a pixel (the X value) to a new brightness (the Y value). At the start, the line is a perfect diagonal, so that each pixel's new value is the same as the old. In this example, I drag the endpoints of this line closer to where pixels actually start showing up in the distribution, and the image changes as the line changes. I then bring up Adjust Color Curves once more, and the histogram now reflects the alterations.


Here's that new histogram, showing the distribution of the pixels after I used Adjust Color Curves. The general shape is the same, but spread out a bit to occupy a greater range of brightnesses.
I did not eliminate all the empty space on either flank of the histogram, because if I had, the changes would have been garish. Small adjustments can be made fully, but for large adjustments I usually don't grab more than 50% of what's possible.

As the last step of the above demo, I also ran the 'Unsharp Mask' function. This is an image-sharpening feature, useful for soft-focus or hazy images. I have learned tread lightly here; for instance, the 'amount' field, which is how much of the calculated adjustment to actually apply, I typically set in the 35%-40% range. Also, faces of people usually look better if you don't highlight their bumps, creases, and shadows -- I just skip sharpening those images.  There are techniques to apply sharpening to just the edges within an image I intend to try out. As always, there is the Undo command in the Edit menu if I mess up!

The results of the 'Unsharp Mask' may not be visible with the screen resolution of this demo. That's OK; in this case, subtle is better. Here is the histogram after Unsharp Mask.
I should mention that the line doesn't have to remain straight. You can add points to the line and adjust only portions of it; that's the wonderful power of this tool. Here's a mapping that brightens the lighter bits as well as increasing contrast:
If I had wanted to tone down the bright areas (bringing out structure in sunlit clouds, for example) I would have lowered rather than raised the rightmost portion of the line.

The next post will talk about stitching together a panorama and about generating a High Dynamic Range (HDR) image, both multi-image creations.

Friday, January 28, 2011

Enthusiastic Bathing Birdies

I checked our BirdCam to see if we'd been fortunate enough to snap a photo of the hawk capturing his lunch. No such luck, but we did get a series of pictures of enthusiastic bathers, which I winnowed down to a few. In summer the birds appreciate a good bath to rid themselves of pests and parasites, and in winter our birdbath, heated just enough to never freeze, exerts an intense attraction.

Here a female cardinal splashes daintily as a junco awaits her turn.
Among the prettiest visitors are the blue jays.
Sometimes the camera catches an avian citizen in flight.
Some species prefer to quickly fly by the bath first, inspecting it on the wing, and perch just beyond. Only when everything looks satisfactory will they land on the rim, and even then they are constantly scanning for danger (deservedly so!). Others, particularly the cardinals, prefer to sneak up on the birdbath by hopping through the honeysuckle vines that entwine the step railings, emerging only at the last moment. 

Robins are year-round, but the bath in winter is a special point of congregation.
Handsome winter-time pests are the starlings. Their peroxided feather-edges catch they eye, but they'll empty the birdbath just from splashing around, and then poop in it.
The petite tufted titmouse is the best. Whee!

Wednesday, January 26, 2011

Lunchtime for the Red-Tailed Hawk

Today Joan noticed the crows making lots of noise. Well, they usually do that, but this time it was loud and angry. She discovered that a red-tailed hawk was in the trees at the edge of the woods eating lunch. I grabbed my camera and gently opened the back door. The hawk gave me enough time for two pictures, one with better exposure, and then decided he didn't care for my looks, flying deeper into the woods to complete his repast.
If you click on the photo, you can see some meat in the hawk's beak, and that the victim is a bird with white underparts and pink legs and feet. I can't identify it, though.

Saturday, January 22, 2011

PlantCam Timelapse with Clivia and Snowfall

In addition to a couple of books, at Christmas time I received a PlantCam, a time-lapse camera from the same outfit that makes the motion-sensitive BirdCam that we've used for the last couple of years. With this blog entry I will subject you to my first time-lapse "compositions." No doubt there will be a learning curve.

Note: the YouTube clips default to a 360p setting, at least for me, but the original material is 480 pixels high. The clips will look much crisper if you go to the 360p that shows up on the right side of the YouTube playback controls and click to change it to 480p. Unfortunately, the clickable 360p shows up only after playback begins! If I ever find a way around this ugliness, I will update this post.

My first subject was a large, nay, huge clivia that grows near our first-floor bay window. In late December Clivia (that's her proper name) starting pushing up a stalk, and I set the PlantCam to take a frame once every 5 minutes, with this clip recording from December 31st to January 17th.


As you can see, the camera position with regard to the sun was poor, causing washout and flaring. (I threw out the worst of the glare-burned frames.)  But it did reveal that Clivia does a lot of growing at night, of which there is a surplus at year's end, with the first frame of each new day showing a jump in the stalk.

The next clip is of the snowfall -- well, the first part of it -- of January 20th. The camera was positioned on a tripod in a protected corner of the front porch, and set to grab one frame per minute. After a while the snow starts to accumulate on the street, and then the snow on the bushes in the immediate foreground piles up. You will notice that I changed the PlantCam setting so that it no longer smacked an intrusive imprint  across the bottom of the frame; instead I wrote a script using ImageMagick, an open-source tool, to create a watermark in the lower left corner with the date and time.


Technical note: the date and time were extracted from each frame of the clip, specifically, from the EXIF data that every modern digital camera includes in a JPEG file. I don't use the PlantCam's ability to create the movie within the camera; first, I would rather have the opportunity to process each frame, as with the watermark, and second, the PlantCam's automatic movie generation cannot handle a large number of frames. I again used an open-source tool, ffmpeg, to generate a movie from the many still images.

The final and best clip is of the very sunny day after the snowfall. The light and shadows make this clip, recorded at one frame every 30 seconds, great fun to watch. Yours truly is one of the early shovelers.


I'll continue to experiment with the PlantCam, and come spring and summer, there will be plenty of daylight.