The View Up Here

Random scribblings about kites, photography, machining, and anything else

Archive for May, 2009

Nyquist Sampling and the Need for Unsharp-Masking

Posted by Tom Benedict on 31/05/2009

Every digital camera takes blurry pictures.  This is not because of any conspiracy between camera makers.  It’s simple physics and good design.  Here’s why:

Let’s say you have a really good lens with outstanding image quality.  And let’s say you’re using that lens to photograph a pinpoint light source like a star on a really clear still night.  The lens won’t be able to focus the star to an infinitessimally small point, no matter how good it is.  This is basic physics.  Instead it will focus to a circle of some very small diameter, on the order of only a few microns for a good lens.  For the sake of discussion let’s pick a number and say eight microns for our lens.  Now let’s say we stick a digital detector behind the lens and try to image the star.  If the detector has pixels that are twelve microns across, the star will under-fill a pixel and will show up as a single pixel in the images.  If the detector has pixels that are two microns across, the image of the star will fill multiple pixels, and it will be resolved as a small, but blurry circle.  The first case is called under-sampling.  You’re not taking full advantage of the optical quality of the lens, and the resulting images may look somewhat jaggy.  The second is called over-sampling.  You’re trying to subdivide the light into too many pixels, and you wind up having to toss half your resolution away because the optical quality of the lens isn’t up to the task.

In an ideal situation a camera’s pixel size should be about half of the finest detail the lens can resolve.  It’s a balance between the two conditions described above.  It’s not so finely sampled that you run into the optical quality of the lens, and it’s not so coarsely sampled that details are lost inside a single pixel.  The result is a fully resolved, but slightly fuzzy looking image. This balance of how finely to sample an analog signal was formalized in the Nyquist-Shannon Sampling Theorem.  The theorem says that if your sampling frequency is twice the highest frequency in your analog data, you can fully reconstruct the original signal.  Put in photographic terms, you want your pixels to be about half the size of the smallest feature your optics can produce.

How this usually works out in practice is this:  A camera manufacturer will take a detector with a given pixel size, and want to build a camera around it.  The specifications are then handed to their optical designers: pixel size, desired focal length, desired maximum and minimum apertures, etc.  The optical designers then design a lens for that detector and hand it to the mechanical designers so they can build a camera body around the lens and detector that will bring the image the lens produces to a good focus on the detector.  A camera built this way produces fully resolved, but slightly fuzzy looking images.  From the standpoint of sampling theory, this is ideal.

But from the standpoint of graphic design, it’s not.  A Nyquist sampled image may have preserved as much of the original analog signal as possible, but it does so at the cost of not having any truly sharp edges in the image.  The images often lack that sharp snappy look that we associate with a really good picture.  When you zoom in to the pixel level they wind up looking a little soft.

Because of this, one of the first things people like to do when bringing an image fresh off a camera into a program like Photoshop is to sharpen it up a little.  Make it a little more snappy.  There’s nothing wrong with this, but it needs to be done with some care.  Over-doing the sharpening can result in an image that looks artifical, or just plain bad.  One of the better tools for this is the Unsharp Mask took.

One question I hear frequently is, “If the tool sharpens the image, why is it called unsharp mask?”  The reason is that the tool doesn’t increase the sharpness of the image.  It decreases the unsharpness through the use of a slightly out of focus, or unsharp image.  Here’s the idea behind it:

Every image has some fuzziness to it.  In the film world it comes from basic physics: no lens is perfect, apertures cause diffraction, etc.  In the digital world you add Nyquist sampling to the equation.  The result, either way, is that every image has some fuzziness to it.  So if you can subtract the fuzziness from the image, the sharpest parts should be what’s left.  The trick is to make an unsharp image, or mask, to subtract.

In the digital world this is fairly straightforward.  You take the original image, blur it out to some degree, and then subtract some percentage of that blurry image from the original.  In the Unsharp Mask tool in Photoshop there are two sliders, Radius and Amount.  These set how blurry your unsharp mask is, and how much of that is subtracted from the original image.  From the previous description of Nyquist sampling, it should be apparent that the Radius needs to match the fuzziness of the image.  It’s not arbitrary.  In perfect Nyquist sampling, that radius should be close to 0.5 pixels.  Designs rarely work out perfectly, though, so your camera’s numbers may vary.  Likewise the amount to subtract is not arbitrary, and should be matched to the detector, lens, and aperture used.  With both sliders, some experimentation is required.

I’ve continued to mention film in this article because unsharp masking is not strictly a digital tool.  Like so many of the tools in Photoshop, unsharp mask has its origins in the film world.  It’s a technique I’ve never used in the darkroom myself, but I’ve known photographers who have.  By far the best description I’ve found is this article on unsharp masking by Alistair Inglis.  It’s worth reading through his article even if you never intend to set foot in a darkroom.  It will give you a better idea of why this technique works, and how it is being done in software.  It’s interesting to see how much of the article focuses on keeping the original negative and the unsharp mask in perfect registration.  This, of course, is not of great concern in the digital world where you can specify precisely where a given pixel will go.  But in the world of film the ability to keep two or more images in perfect registration can make or break any number of techniques that have been developed over the years.  It’s a fascinating article, and good food for thought.

— Tom

Posted in Photography | Tagged: , , , , , , | Leave a Comment »

Mechanics of KAP

Posted by Tom Benedict on 28/05/2009

On the off-chance that my previous post sparked some interest in doing kite aerial photography, I’ll go into the mechanics of actually hanging a camera from a kite line, and convincing it to do what the photographer wants.  The approach used can be anything from quite simple to otherworldly complex.  A lot depends on what the photographer actually needs, but even more depends on what the photographer is convinced they want.  It’s important to keep these two ideas separate when you look at hanging a camera from a kite line.

Lightweight Rig - Ready to Fly

By far the simplest KAP rig I use is one I designed spedifically for doing mapping.  It was built for one specific trip, but it’s such a versatile rig I’ve used it numerous times since.  The requierments of the trip drove the design:  For starters, there is very little wind at the site, so lifting a heavy KAP rig was out of the question.  The bulk of the weight in this rig is the camera itself.  The rig’s weight is almost negligible.  For the purpose of mapping, all the pictures needed to be as orthogonal as possible, so there is no provision to tilt or pan the camera.  And we would need to take pictures over the course of several hours with no opportunities to change batteries during the flight, so battery life was of paramount importance.

There is no provision for the photographer to tell the camera when to take a picture.  Instead the camera is running CHDK, a toolkit that runs on top of the camera’s native firmware.  In this case CHDK was running an intervalometer script that let the camera take pictures every five seconds without any user intervention.  No mechanical linkages, no servos, no fancy electronics, just the camera itself running a pre-canned program.

Lightweight Rig Airborne

In the end the rig performed marvellously.  Complete with camera and the four AA batteries the camera requires, the rig came in just over 450g.  It flew on one set of batteries for two straight days, and took more than 2,000 photographs.  The photos from that trip are being used to map an archaeological site, and will be used in papers that should be published in the next year or so.

Current Rig - Late 2008

At the other extreme is my radio controlled KAP rig.  It’s built almost entirely out of off-the-shelf parts from Brooxes, the main supplier of commercial KAP equipment. The rig allows the photographer to pan and tilt the camera, and to operate the shutter.  Brooxes sells other components that would allow the camera to rotate from horizontal to vertical, and other accessories exist that allow the photographer additional control over the camera itself.

The rig started off as a Brooxes BBKK, but over the course of a few years I added a carbon fiber leg kit, gear reduction for the pan axis, a set of PeKaBe blocks for the suspension, and a number of other improvements.  Two changes have been made since this photograph was taken:  The first was to replace the aging 72MHz AM radio with a 2.4GHz Turborix.  The second was to remove the shutter servo and replace it with a GentLED-CHDK.  Unfortunately I haven’t photographed this rig since the changes were made.

The GentLED-CHDK is one of the cooler pieces of hardware I’ve bought for my rig.  It is a smart cable that plugs into the RC receiver on one end, and the camera’s USB port on the other.  When the photographer flips the shutter control on the RC transmitter (in my case I set it up as a switch rather than a joystick), the GentLED-CHDK sends +5V down the USB cable to the camera.  One of the features of CHDK is that you can monitor the +5V line on the USB port and take action when the camera sees it.  In my case I run a script on my camera that says as long as +5V is being applied, behave as if the shutter button is being held down.  In single-shot mode, this means each time I flip the switch the camera will take a picture.  In continuous shutter mode this means that I can hold down the switch on the transmitter and the camera will keep taking pictures as fast as it can, roughly every 1.1 second.

The two rigs are as different as they could be and still get the job done.  One was the product of a few hours of thinking and about an hour’s worth of time in the shop.  Total expenditure was maybe $50 for the Picavet suspension, most of that being the PeKaBe blocks.  The bulk of the rig came out of the scrap box.  The other was the product of a few years of tinkering with a commercial rig.  Total expenditure is probably several hundred dollars by now, but still probably less than a good carbon fiber tripod and professional ball head.

What is important to take away from this is that there is no one right way to hang a camera from a kite line.  And depending on what you actually need, an extremely simple rig like the ortho mapping rig may get the job done just as well as a more complicated, heavier rig like the BBKK.  Before becoming discouraged at the prospect of designing and building a rig from scratch, consider the commercial options.  And before becoming discouraged by the cost of the commercial kits, consider the possibility of simplifying your requirements and making one yourself.

It’s possible for anyone to do aerial photography.  If you want to do it, do it.

— Tom

Posted in Kite Aerial Photography, Photography | Tagged: , , , , , , , , , | Leave a Comment »

Why Take Pictures From A Kite?

Posted by Tom Benedict on 28/05/2009

“Why take pictures from a kite?”

It’s a question I hear fairly often when I try to describe kite aerial photography to someone who’s never seen me at work.  Oddly enough I never get this question when I’m out in the field.  The reason for this, I’m pretty sure, is that once you see it being done the answer is fairly obvious.

Lighthouse from Up High

In short, because I can.  And because it works so very very well.

The related questions, “Why not do it from an airplane?” or “… a helicopter?” or “… a UFO?” also have a pretty short answer:  Because I can’t.  Or at least I choose not to.  For starters, I don’t have access to a UFO (though as it turns out I do.)  By the same token, I don’t have access to an airplane or a helicopter, either.  Sure, I could rent one, but I’m not a pilot.  I could rent a pilot, too, but they cost a lot.  In Hawaii where I live, an hour in a Robinson helicopter that’s had its doors removed, but not its pilot, costs roughly $350.  Not too expensive on the face of it, but it comes with some restrictions.  First, it’s only for one hour.  I regularly leave my KAP rig in the air for hours at a stretch, waiting for just the right light or just the right action.  Next, helicopters and airplanes all have to stay over 1000′ above ground level.  A KAP rig stays less than 500′ above ground level.  The views really are different.  And finally, three hours in a Robinson would pay off all of my KAP gear with change left over for making prints.

Top of the Lighthouse II

The second point in the previous paragraph, the one about viewpoint, is often lost on people.  If some altitude is good, wouldn’t more altitude be better?  If your goal is to look for camouflaged rocket batteries or some other secret military facility, sure.  This is why a great deal of the military’s reconnaisance is done from satellites.  But if the goal is to produce an intriguing photograph, more altitude often spoils the view.  If greater subject distance was always preferable, landscape photographers wouldn’t need wide angle lenses, would they?

Top of the Lighthouse I

Besides, the camera equipment necessary to render fine details from even a thousand feet away is not the most affordable, or even the most portable thing in the world.  I would argue that the previous photograph could not have been produced with a long lens and a longer subject distance.  But even if it could, without a stabilized camera platform and a truly remarkable camera and lens, the level of detail avaialble from such a photograph would not be all that impressive.

Too Close for Comfort!

It’s one thing to stand at the base of a lighthouse and wonder what it looks like on top, and only be able to satisfy your curiosity by driving to an airport, renting a helicopter, convincing the pilot to fly to the lighthouse, and only then find out the answer.  It’s quite another to reach into your backpack, pull out a kite, line, and rig, and by golly find out right then, right there.

Why take pictures from a kite?  Because I can.

Green Sand I

— Tom

The photos used in this post were all taken from a camera suspended from a kite line during World Wide KAP Week 2009.

Posted in Kite Aerial Photography, Photography | Tagged: , , , , , , , , | Leave a Comment »