Last year, I bodged together a motion detecting camera to photograph hummingbirds at my hummingbird feeder. But it was always a temporary hack. We had some difficulty with the ants that discovered the feeder, and we discontinued the experiment.
I had a post that I could hang some feeders from, and decided to fill a planter with cement and embed the post so I could move it around and hose it down easily. It’s working pretty well: last weekend we finished it, and have already had to refill the feeder. I think I’ve identified at least three to four hummingbirds who are feeding there, although they seem quite territorial, and one of the larger ones often scares off the smaller ones.
But he doesn’t seem to bother this guy:
I’m not much of a bird watcher, but a little googling suggests to me that he’s a Hooded Oriole. They seem to like the sugar water from hummingbird feeders, and slurp up a fair amount of this stuff when they land. I’ve seen a female of the species as well, who is a bit paler and lacks the black markings surrounding the eye.
I’ll try to get the motion detecting camera up sometime in the next few weeks.
While I was dinking around with my binoculars during the eclipse last night, I decided to try to hunt for an application which would allow me to have better control over the exposures etc. on my iPhone. I found the program Manual, which gives SLR like controls (more on that some other time) but I also found out about NightCap Pro, a program that can be used to take star trail photos and long exposures. For a mere $1.99, I could not resist. I downloaded it, read over the manual, and wandered out into my backyard. I couldn’t immediately find my iPhone tripod, so I just rested it on a flower pot aimed roughly up the hill, and snapped this photo with a roughly 30 second exposure.
I was actually pretty impressed. You can see clearly a few stars, as well as the high clouds. The scattered light from my porch and the full moon was enough to clearly show the color of the foiliage as well as my humming bird feeder. I mulled for a moment about what constellation I was looking at, but then realized the bright star was Vega, and the stars above and to the left of it were Lyra. I cropped it down to eliminate the terrestrial landmarks. You can see that the star images are pretty soft and out of focus, I didn’t figure out how to lock the focus at infinity, I’ll try in the future.
If you haven’t heard of astrometry.net, it is a cool website which allows you to upload star field pictures, and it will figure out where the stars were aiming, and then label the stars and constellations. When I handed it the cropped version, it confirmed my suspicion that it was Lyra, but also showed the stars in Cygnus that are above it.
Great fun! The program can also take pictures of star trails and satellites. I’ll have to give that a try sometime soon. Stay tuned.
My goal in experimenting with the Raspberry Pi camera was to try to make an efficient and effective camera which can detect motion. Previous incarnations of the camera script merely looked at the differences in pixel values between adjacent frames, thresholded them at some value, and then counted the number of pixels which exceeded this value. What I discovered was that it was pretty hard to tune the two threshold values in a way that would not pick up changes due to wind motion of the grassy background.
But it turns out that the Raspberry Pi Camera and its associated software picamera has some other tricks up their sleeves. In addition to recording the h264 encoded video, you can record an alternative stream which contains “motion data”, which is essentially some of the raw data that is used by the h264 to do motion coding. Essentially this data provides 4 bytes of data for each 16×16 image block: two signed 8 bit image displacements (in x and y) which represents the estimated image velocity, and a 16 bit value which is the sum of the absolute difference of all the pixels in the block from the previous frame. Both would be rather expensive to compute (certainly in Python) but are quick and easy to extract when computed by the camera itself.
To test my understanding, I modified my camera script to acquire this data, and then transferred it along with the normal video, and then hacked together some scripts using python and gnuplot to superimpose this data atop the background video (which I’ve faded a bit to make the data more legible). The black contours represent the difference data, and are spaced at intervals of 100. The red vectors represent the motion data plotted atop the image.
One thing leaps out at me immediately: the motion data is very good at finding the hummingbirds, even when the birds are relatively stationary. While this clip was not taken in particularly high wind, it’s pretty clear that those vectors aren’t very large in the case of plant motion. Hence, it seems clear I could make a better motion detector by taking advantage of the precomputed motion vectors.
A couple of things remain though: there are obviously drop outs where the contour data drops out entirely. I’m not sure what that is about: it could be a bug in my conversion script, or something more insidious. I’ll go back to the data and find out. Secondly, I’m not sure how capturing this motion data interacts with another feature I use of the picamera: it’s ability to record into circular memory buffers. When I figure out these two issues, I’ll post (and likely github) another version of my watcher script.
Hope this is of interest to someone out there.
Addendum: While doing more reading on the picamera github site, I found a link to this awesome script, which points out a lot of clever things that can be done. I’ll be swiping ideas from it soon!
My previousexperimentswith a foam core 4×5 camera has whetted my appetite for more camera experiments. In particular, I was looking for cameras that could be built quickly, and where amateurs could construct their own lenses out of surplus optics. I am particularly interested in cameras that use the old fashioned meniscus landscape lens design, which takes just a single meniscus lens, and symmetric lens designs like the Steinheil Periskop. Most DIY camera projects seem to fall back to using modern or antique lenses, but I did come across two cameras from the same maker that took a more basic approach.
This large format camera is basically a pinhole camera, but with a stop right at the lens, yielding a focal ratio of about 90. Check out the flickr set, which includes both pictures of the camera and taken through the camera. This camera doesn’t include a focus mechanism, but since it is operating around f/90, it already has a great deal of depth of focus. It straddles the line between a pinhole and a conventional camera. But still, it creates some cool images.
The same maker created another awesome camera, but this one is a lot more awesome. The frame is wood, it has a focusing bellows, and takes a 4×5 film holder. The Flickr set for this camera shows some really awesome portraits, and one can tell it’s a lot more versatile and fun to use. Awesome, inspiring stuff.
My recent experiments with large format photography with primitive cameras has me googling and surfing around. In my rampant clicking, I uncovered this very simple camera, which is even simpler than the 4×5 cameras that our class constructed. It’s just a positive meniscus lens with a 120 mm focal length, stopped down to f/90, held in place by something called “patafix” (a kind of clay adhesive) and used to illuminate an 8×10 paper negative. At f/90, it’s definitely straddling the line between pinhole and a real lens. There is no provision for focusing at all. But at f/90, the depth of focus is rather large, and his examples are pretty impressive. Worth checking out. You can see an album of pictures from this camera here on Flickr.
Here are two more photos I took at last night’s camera workshop. I wanted to take something slightly more beautiful than a selfie, so I chose the Luxo statue outside the Steve Jobs building at Pixar, and some white flowers from the garden. Both were taken rather late in the day, under partly cloudy skies using a 4 second exposure on some paper with an ASA value of around 4, and a 4 second exposure (timed by my accurately counting “Mississippis”). Both were shot at f/24. I scanned them using our copy machine at 600dpi, and then inverted them in gimp. I didn’t do any further processing on the Luxo. With the flowers, I adjusted the curve slightly to bring out some details in the darks between the flowers. I saved these versions as JPEGs, click on them to see them full resolution.
If you look to the upper right of the Luxo, you can see that there are some significant off-axis aberrations, as is also apparent in the background of the flowers. But the center of the field is remarkably sharp, considering. I’m rather pleased.
Over the years that I’ve been interested in computer graphics and telescopes, I’ve managed to pick up a bit of knowledge about optics in general, and specifically about camera lens design. In the past, I’ve been particularly interested in old cameras and photography, and in a kind of photographic minimalism. But it has remained mostly an academic interest, with no real practical results.
I was recently asked to provide a little bit of background on camera lenses and lens design at an informal workshop. The purpose of the workshop was for each participant to build and use a camera of their own construction. I’ve taken similar courses before where we did pinhole photography. Here’s the apex of that experiment, a picture of my desktop:
Taken with this camera. Note the curved back, which results in the odd panoramic distortion of the previous picture.
But this time class was a bit more ambitious. We were going to make cameras that would shoot on 4×5 film, and use a real lens (or lenses) to give us faster focal ratios and interesting distortions and other effects. We ordered some lenses with focal lengths of around 150mm from Surplus Shed for a few bucks apiece (favoring some positive meniscus lenses, as well as some with about 300mm that we thought we’d experiment with some symmetrical lens arrangements, got some 4×5 sheet film holders, and a pile of black foamcore and gaffer tape. Each person’s camera was a bit different. Here’s mine:
It’s a pair of boxes about 7″ across which telescope together. To create a bit of a light trap, there is both an inner and an outer box in the back, and the section which holds the lens slips in between those two, and also provides a rough focussing mechanism. The lens is a meniscus with about 150mm focal length, and about 50mm in diameter. It’s not an achromat, just a simple lens, configured as a Wollaston landscape lens. I constructed a small box to hold it about 1 inch behind the front of the camera, and then punched a 1/4″ hole in some black paper to serve as a stop. Instead of a true shutter, I decided to just make a little trap door. For our first tests, we were going to image directly onto photographic paper, which had an ASA rating of around 3 or 4. With the 1/4″ stop in place, my camera operates at around f/24. To make my first “selfie” in room light, I guestimated an exposure time of 30 seconds. The first exposure was far too light. I then caved and used a smartphone app to give a better estimate, and it suggested a three minute exposure time. I shot this on ASA 3 positive paper. I triggered the shutter myself, then sat down and tried to be as still as possible. When the time was up I got back up and closed the shutter. Into the darkroom… and bathing in the rinse!
I cropped the picture and scanned it, cropped it, did a very tiny exposure tweak to darken it a bit (probably should have left it in the developer a touch longer), and here’s my selfie:
I’ll try to get some new shots next week. But it’s a fun project, I urge anyone to give it a try. These simple lenses are more effective than you would think.
I might have an opportunity in a couple of weeks to go do some kite flying at an upcoming picnic, and I thought that I might give a quick try at quick and dirty kite photography. After all, I’ve been musing about lofting a camera up high using a weather balloon, so why not start with elevations of just a few hundred feet? I haven’t given this much study or thought, but I know that designing an appropriate rig for attaching the camera to the line is a key element. My idea is to loft my old Canon SD1100 on a little gadget which is known as (I had to look it up) a Picavet. It’s a fiendishly simple and clever device for keeping the camera basically level while attached to the kite string. Check it out:
I’m a huge fan of gadgets which have the possibility of open source third party updates. I have a couple of Linksys routers that I’ve reflashed with DDWRT and/or Tomato and/or OpenWRT. I’ve played with the NSLU2. I have a Canon SD1100 which I run CHDK.
This is firmware for the Canon 5D Mark II DSLR to adapt it to the specific needs of film makers. While the 5D is nominally intended as a still camera, it has many advantages when compared to equivalently priced setups when used as a motion picture camera. This firmware is designed to expand this use considerably. Very cool.
I have a little Canon SD1100 that I picked up a while ago. One of its cool features is its ability to run the alternative CHDK firmware. It includes many interesting features, such as scripting, improved time lapse photography and such, but it also includes the ability to do really fast shutter speeds. I was dinking around with it a bit yesterday for a few minutes, and got this picture, taken with a 1/16000th second shutter speed. It’s not great as a photograph, but it hints at what is possible.