Shallow Thoughts : : photo

Akkana's Musings on Open Source Computing and Technology, Science, and Nature.

Thu, 02 Oct 2014

Photographing a double rainbow

[double rainbow]

The wonderful summer thunderstorm season here seems to have died down. But while it lasted, we had some spectacular double rainbows. And I kept feeling frustrated when I took the SLR outside only to find that my 18-55mm kit lens was nowhere near wide enough to capture it. I could try stitching it together as a panorama, but panoramas of rainbows turn out to be quite difficult -- there are no clean edges in the photo to tell you where to join one image to the next, and automated programs like Hugin won't even try.

There are plenty of other beautiful vistas here too -- cloudscapes, mesas, stars. Clearly, it was time to invest in a wide-angle lens. But how wide would it need to be to capture a double rainbow?

All over the web you can find out that a rainbow has a radius of 42 degrees, so you need a lens that covers 84 degrees to get the whole thing.

But what about a double rainbow? My web searches came to naught. Lots of pages talk about double rainbows, but Google wasn't finding anything that would tell me the angle.

I eventually gave up on the web and went to my physical bookshelf, where Color and Light in Nature gave me a nice table of primary and secondary rainbow angles of various wavelengths of light. It turns out that 42 degrees everybody quotes is for light of 600 nm wavelength, a blue-green or cyan color. At that wavelength, the primary angle is 42.0° and the secondary angle is 51.0°.

Armed with that information, I went back to Google and searched for double rainbow 51 OR 102 angle and found a nice Slate article on a Double rainbow and lightning photo. The photo in the article, while lovely (lightning and a double rainbow in the South Dakota badlands), only shows a tiny piece of the rainbow, not the whole one I'm hoping to capture; but the article does mention the 51-degree angle.

Okay, so 51°×2 captures both bows in cyan light. But what about other wavelengths? A typical eye can see from about 400 nm (deep purple) to about 760 nm (deep red). From the table in the book:
Wavelength Primary Secondary
400 40.5° 53.7°
600 42.0° 51.0°
700 42.4° 50.3°

Notice that while the primary angles get smaller with shorter wavelengths, the secondary angles go the other way. That makes sense if you remember that the outer rainbow has its colors reversed from the inner one: red is on the outside of the primary bow, but the inside of the secondary one.

So if I want to photograph a complete double rainbow in one shot, I need a lens that can cover at least 108 degrees.

What focal length lens does that translate to? Howard's Astronomical Adventures has a nice focal length calculator. If I look up my Rebel XSi on Wikipedia to find out that other countries call it a 450D, and plug that in to the calculator, then try various focal lengths (the calculator offers a chart but it didn't work for me), it turns out that I need an 8mm lens, which will give me an 108° 26‘ 46" field of view -- just about right.

[Double rainbow with the Rokinon 8mm fisheye] So that's what I ordered -- a Rokinon 8mm fisheye. And it turns out to be far wider than I need -- apparently the actual field of view in fisheyes varies widely from lens to lens, and this one claims to have a 180° field. So the focal length calculator isn't all that useful. At any rate, this lens is plenty wide enough to capture those double rainbows, as you can see.

About those books

By the way, that book I linked to earlier is apparently out of print and has become ridiculously expensive. Another excellent book on atmospheric phenomena is Light and Color in the Outdoors by Marcel Minnaert (I actually have his earlier version, titled The Nature of Light and Color in the Open Air). Minnaert doesn't give the useful table of frequencies and angles, but he has lots of other fun and useful information on rainbows and related phenomena, including detailed instructions for making rainbows indoors if you want to measure angles or other quantities yourself.

Tags: , ,
[ 13:37 Oct 02, 2014    More photo | permalink to this entry | comments ]

Fri, 15 Aug 2014

Time-lapse photography: stitching movies together on Linux

[Time-lapse clouds movie on youtube] A few weeks ago I wrote about building a simple Arduino-driven camera intervalometer to take repeat photos with my DSLR. I'd been entertained by watching the clouds build and gather and dissipate again while I stepped through all the false positives in my crittercam, and I wanted to try capturing them intentionally so I could make cloud movies.

Of course, you don't have to build an Arduino device. A search for timer remote control or intervalometer will find lots of good options around $20-30. I bought one so I'll have a nice LCD interface rather than having to program an Arduino every time I want to make movies.

Setting the image size

Okay, so you've set up your camera on a tripod with the intervalometer hooked to it. (Depending on how long your movie is, you may also want an external power supply for your camera.)

Now think about what size images you want. If you're targeting YouTube, you probably want to use one of YouTube's preferred settings, bitrates and resolutions, perhaps 1280x720 or 1920x1080. But you may have some other reason to shoot at higher resolution: perhaps you want to use some of the still images as well as making video.

For my first test, I shot at the full resolution of the camera. So I had a directory full of big ten-megapixel photos with filenames ranging from img_6624.jpg to img_6715.jpg. I copied these into a new directory, so I didn't overwrite the originals. You can use ImageMagick's mogrify to scale them all:

mogrify -scale 1280x720 *.jpg

I had an additional issue, though: rain was threatening and I didn't want to leave my camera at risk of getting wet while I went dinner shopping, so I moved the camera back under the patio roof. But with my fisheye lens, that meant I had a lot of extra house showing and I wanted to crop that off. I used GIMP on one image to determine the x, y, width and height for the crop rectangle I wanted. You can even crop to a different aspect ratio from your target, and then fill the extra space with black:

mogrify img_6624.jpg -crop 2720x1450+135+315 -scale 1280 -gravity center -background black -extent 1280x720 *.jpg

If you decide to rescale your images to an unusual size, make sure both dimensions are even, otherwise avconv will complain that they're not divisible by two.

Finally: Making your movie

I found lots of pages explaining how to stitch together time-lapse movies using mencoder, and a few using ffmpeg. Unfortunately, in Debian, both are deprecated. Mplayer has been removed entirely. The ffmpeg-vs-avconv issue is apparently a big political war, and I have no position on the matter, except that Debian has come down strongly on the side of avconv and I get tired of getting nagged at every time I run a program. So I needed to figure out how to use avconv.

I found some pages on avconv, but most of them didn't actually work. Here's what worked for me:

avconv -f image2 -r 15 -start_number 6624 -i 'img_%04d.jpg' -vcodec libx264 time-lapse.mp4

Adjust the start_number and filename appropriately for the files you have.

Avconv produces an mp4 file suitable for uploading to youtube. So here is my little test movie: Time Lapse Clouds.

Tags: ,
[ 12:05 Aug 15, 2014    More photo | permalink to this entry | comments ]

Wed, 21 Jul 2010

Writing scripts for your Canon camera with CHDK

On Linux Planet yesterday: an article on how to write scripts for chdk, the Canon Hack Development Kit -- Part 3 in my series on CHDK.

Time-Lapse Photography with your Inexpensive Canon Camera (CHDK p. 3)

I found that CHDK scripting wasn't quite as good as I'd hoped -- some of the functions, especially the aperture and shutter setting, were quite flaky on my A540 so it really didn't work to write a bracketing script. But it's fantastic for simple tasks like time-lapse photography, or taking a series of shots like the Grass Roots Mapping folk do.

If you're at OSCON and you like scripting and photos, check out my session on Thursday afternoon at 4:30: Writing GIMP Plug-ins and Scripts, in which I'll walk through several GIMP scripts in Python and Script-Fu and show some little-known tricks you can do with Python plug-ins.

Tags: , , , , , ,
[ 10:31 Jul 21, 2010    More photo | permalink to this entry | comments ]

Thu, 08 Jul 2010

Article: CHDK part 2

Part 2 of my series on hacking Canon point-and-shoot cameras with CHDK: Turn Your Compact Canon Camera Into a Super-Camera With CHDK, discusses some of CHDK's major features, like RAW image file support, "zebra mode" and on-screen histograms, and custom video modes (ever been annoyed that you can't zoom while shooting a video?)

Perhaps equally important, it discusses how to access these modes and CHDK's other special menus, how to load CHDK automatically whenever you power the camera on, and how to disable it temporarily.

Part 3, yet to come, will discuss how to write CHDK scripts.

Tags: ,
[ 17:27 Jul 08, 2010    More photo | permalink to this entry | comments ]

Wed, 23 Jun 2010

Article: Customize or Hack your Canon camera with CHDK

My latest Linux Planet article came out a day early: RAW Support (and more) For Your Canon Camera With CHDK.

CHDK is a cool way you can load custom firmware onto a Canon camera. It lets you do all sorts of useful hacks, from saving in RAW format even in cameras that supposedly don't allow that, to getting more control over aperture, shutter speed and other parameters, to writing scripts to control the camera.

I didn't have space for all that in one article, so today's Part 1 simply covers how to install CHDK; Part 2, in two weeks, will discuss some of the great things you can do with CHDK.

Tags: ,
[ 20:02 Jun 23, 2010    More photo | permalink to this entry | comments ]

Tue, 02 Sep 2008

DSLR Camera Foo

I thought it would never happen ... I've finally joined the Digital SLR world.

Why would it never happen? I enjoyed film SLRs for years ... from the Olympus OM-1 (great little manual camera) I had as a teenager to the Nikkormat EL and Nikon FG I used a decade ago. I only stopped because processing and scanning slides was such a hassle compared to the ease of uploading digital images. So why not a DSLR?

The problem was that when Nikon went digital, they orphaned all their old manual-focus lenses. They're still physically compatible (they'll screw on to the DSLR body), but peeved Nikon DSLR owners inform me (and camera store clerks agree) that the Nikon cameras won't meter with the old lens attached.

I don't mind doing my own focusing (manual focusing is one of the prime advantages of an SLR, not a disadvantage) but having to guess at the exposure setting too? "Oh, just carry a light meter," people say. On a camera that costs over $600? That bothers me.

So I was peeved at Nikon and not about to buy anything from them ... but meanwhile I had all these lenses, and hated to buy some other brand where the lenses wouldn't even screw on. So, no DSLR for me ...

Until I was pouring out my lens-mount frustrations during a camera discussion one night on #gimp and one of the regulars (thanks, Liam!) said "Well then, why don't you just get an adaptor that lets you use Nikon MF lenses on a Canon?"

A what? said I.

Sure enough, there are lots of them on Ebay ... search for canon nikon adaptor or look at Gadget Infinity's "lens adaptor" section. You can even (for a little more money) get a "confirm" lens that lights up the autofocus-confirm points in the viewfinder to tell you when the camera thinks you're in focus.

A few months passed (too busy to do camera research) but eventually I found the time and budget ... and now I have a 5-day-old Canon Rebel Xsi, which indeed takes excellent photos (correctly metered) through my old Nikon AI-mount Sigma 70-300 APO zoom macro. And the 18-55 kit lens (the equivalent of a 29-88 in a 35mm camera) isn't bad either -- a little slow (f/3.5 at the widest) but decently wide at the wide end (in the years of using pocket digicams I'd forgotten how much nicer it is to have a true wide-angle lens) and with a nice close focus for macros at the long end.

Even the autofocus isn't bad -- there are still plenty of times when I need manual, but the Rebel's autofocus is much faster and more accurate than any I'd seen on earlier cameras.

[The Canon says F00] It's such a great feeling to use an SLR again. The morning after the camera arrived, I looked up and saw goldfinches at the feeder just outside the window. I picked up the camera, switched it on, pointed, zoomed, focused and snapped. No worries about whether the camera might have decided to focus on the window, or the window frame, or the tree, or the bush -- just focus and shoot. What a pleasure!

And the best part: this must be a camera made by geeks, because when it has the Nikon lens attached ... it says F00!

Tags:
[ 20:59 Sep 02, 2008    More photo | permalink to this entry | comments ]

Thu, 25 Aug 2005

Dowitcher Photo Published!

I was contacted months ago regarding a photo on my web site asking whether it could be used along with an article on molting patterns in Dowitchers in Birding magazine.

Months went by (print magazines are slow) and I wondered if the plan had been dropped, but last week I heard from the author, Caleb Putnam, and the article is in the current (July/August) issue! Yesterday I received a copy of the magazine and a modest payment. Cool!

Even cooler, the photo is the frontispiece of the article. The author says he's received many comments about how great a shot it is for illustrating molt gaps. That's a pull quote if I ever heard one: "Great shot for illustrating molt gaps."

The article is interesting as well -- I didn't know that molt patterns could identify the two species of dowitcher. Telling long-billed and short-billed dowitchers apart has been beyond my modest birding skills, but perhaps I'll have better luck now. I'll be heading out to Baylands today at lunch to see what the dowitchers are doing ...

Tags:
[ 11:49 Aug 25, 2005    More photo | permalink to this entry | comments ]

Sun, 04 Jul 2004

Musings on photo workshops and classes

Dan's party was last night, including an group which was giving an informal workshop on night photography.

The presentation was a little disappointing, just people showing slides of recent photographs. No discussion of techniques or interesting ideas for night photography, things to try out that night.

It was mildly fun for the couple of us who were Linux users to watch the Windows people fumble with their JASC slideshow program trying to get it to present photos at a reasonable size. Whenever I wonder why I bother to keep maintaining pho, I look at what Windows and Mac people have to go through to look at photos and am amazed all over again.

But strangely, before heading off to Marin yesterday, I did some searching for other linux image viewing programs, to see if they'd solved the window manager problems I've been wrestling with for pho. Amazingly, I couldn't find a single free program in Debian that did what pho does (namely, view a list of images serially, at full size or screen resolution). I had to search for xv source (not in Debian, probably licensing issues), which requires a couple of tweaks to get it to build on linux, and which has the same window management issues pho has. I guess I'll keep maintaining it after all!

After dark we trooped up the hill to photograph lights (Richmond and the Richmond-San Rafael bridge were visible, along with parts of Marin) and wait for moonrise. I took an SLR and the Minolta, and wish I'd taken the Olympus -- nearly everyone else had digital SLRs (Canon) and I wished for something with a decent zoom which would still give me exposure feedback. It's not as if bay area skies can support long star-trail exposures anyway. Moonrise was lovely, a sliver of moon emerging above a thick cloudbank centered over the San Rafael bridge, and growing into a full-sized moon. I hope some of the film photos (on old expired PJM multispeed film!) come out.

Most of the photographers there knew each other from previous classes (I wasn't clear how many are students versus instructors) and most of the group spent the hour before moonrise clustered together taking turns taking the same shot, a person silhouetted against the lights of Richmond while someone else fired a flash from behind the person, back toward the camera, giving an "aura" effect around the silhouette and lighting the nearby grass a bit. Not really knowing anyone, I hung back and instead worked on photos of the various photographers silhouetted against the sky (which may or may not come out; I was shooting from 10 sec to about 3 min, betting on the Marin sky being too bright for longer star trails, but we'll see. One of the other solo shooters was shooting 10 minute exposures and people kept walking into her frame.) Dave shot a few Canon digicam images before the sunset light was completely gone, then the wind got to him and he went back to the house and didn't wait for moonrise.

I'd wondered about maybe taking one of their regular workshops, but this outing was a bit like the couple of other photo workshops I've done: no real instruction or sharing of ideas, basically just a bunch of people wandering around taking photos. If you have specific questions or know the instructors already you might be able to get questions answered, but as a person new to the group, I felt like I'd probably do just as well just going somewhere on my own and taking a lot of photos.

It may be that their multi-day pay workshops involve more instruction, and more feedback the next day on images taken at the workshop. I'm curious about that; the few photo seminars and classes I've taken have also promised feedback afterward, but haven't had much, if any.

Sometimes I think that the ideal format for a photo workshop is an online class: give assignments, then people post their photos a few days or a week later, and everyone discusses them, then you go off to the next assignment with what you learned based on the feedback. The important parts are the discussion and the feedback, not being in the same physical place during the shooting (since not much instruction seems to take place then, for most participants, and if it does it seems to be of the type "everybody line up and take exactly the same photo"). It's hard to do feedback in a several-day workshop at a place like Death Valley when people are shooting film and you can't get it developed quickly enough; a digital camera might be a prerequisite to getting much out of that sort of workshop.

Tags:
[ 11:00 Jul 04, 2004    More photo | permalink to this entry | comments ]

Syndicated on:
LinuxChix Live
Ubuntu Women
Women in Free Software
Graphics Planet
DevChix
Ubuntu California
Planet Openbox
Devchix
Planet LCA2009

Friends' Blogs:
Morris "Mojo" Jones
Jane Houston Jones
Dan Heller
Long Live the Village Green
Ups & Downs
DailyBBG

Other Blogs of Interest:
DevChix
Scott Adams
Dave Barry
BoingBoing

Powered by PyBlosxom.