The Smell of Molten Projects in the Morning

Ed Nisley's Blog: Shop notes, electronics, firmware, machinery, 3D printing, laser cuttery, and curiosities. Contents: 100% human thinking, 0% AI slop.

Category: Photography & Images

Taking & making images.

  • Camera LCD Sunshade & Magnifier: Part 1

    Viewer attached to camera
    Viewer attached to camera

    Mary take her gardening pictures with our Sony DSC-F505V camera, which has one compelling advantage for the job: the lens and body pivot, so you can take pix at odd angles without groveling in the dirt or hovering over the camera staring downward. Alas, it lacks an optical viewfinder, which means she does a lot of outdoor close-up photography peering into a washed-out LCD panel in full sun. Worse, she’s far-sighted and can’t see fine details without her reading glasses or bifocals, so it’s really hard to get proper focus.

    Something must be done!

    The general notion is to put an opaque shield around the LCD with a lens that magnifies the viewfinder. If you happen to have perfect near vision, the lens is optional and you can probably use one of the commercial sunshades that attach with hook-and-loop strips. That isn’t going to work for us.

    With inspiration from that project, I retired to the Basement Laboratory. [Update: a somewhat less intricate do-it-yourself project starting with a slide viewer. I suspect it works better for normal-looking cameras, not this one.]

    Raw material: rectangular lens and opaque bottle
    Raw material: rectangular lens and opaque bottle

    Rummaging in the Bottle Supply turned up a dark brown plastic bottle made from PETE, the same stuff that makes soda bottles, with a black plastic snap-cap lid. PETE has a glass transition temperature around 75C, which means you can reshape it with a heat gun (not, alas, a hair dryer). Actually, I found two bottles, so I have a backup.

    A bit of soaking in water, followed by a generous application of xylene, got rid of the label & adhesive residue. You can get xylene in small quantities as Goof-Off adhesive remover or just buy a quart at your local big-box home-repair store. Do the xylene part outdoors and don’t toss the rags in the trash until they’re dry.

    Further rummaging in the Lens Supply turned up a 34.4×22.1 mm plano-convex rectangular lens with perhaps a 100 mm focal length. Haven’t a clue where it came from, but perhaps from the Surplus Shed optical supply shop. Pretty nearly any lens with those general specs will work, so use what you have. You do have a box of lenses, don’t you?

    Putting the flat side of the lens close to my (distance-corrected, I’m nearsighted) eyeball and looking through it at the LCD from about 75-125 mmm produces a very nicely enlarged, distortion-free image. This will work!

    Bottle cutting and forming
    Bottle cutting and forming

    The bottle is much thicker than a soda bottle, but easily cut with a razor knife and a bit of care. I removed the bottom and measured the ID as 68 mm. The circumference is, obviously, 214 mm, which is a key dimension: it must fit around the LCD’s perimeter with a bit to spare.

    I made a wood mould block that’s sized and shaped roughly like the back of the camera around the LCD: Mr Block, meet Mr Belt Sander. This avoids the prospect of melting the camera with the heat gun, as it’s largely plastic, too.

    The block is 52×57 mm, for a perimeter of 218 mm, and a totally non-critical 38 mm tall (it came from a 2×4″ chunk of lumber). The pyramidal section acts as a forcing cone to persuade the bottle to stretch around the slightly larger block and become nicely rectangular as it does.

    Wood forming block
    Wood forming block

    Position the bottle over the block, apply the heat gun all around, and ram the bottle downward as it softens. Eventually the bottle will eat the block, even though it’s not completely happy about doing so, at which point you can concentrate on heating each side separately. The bottle will settle down and stretch neatly around the block, giving it a rectangular base with a smooth transition from the round top. The cut edge tends to curl outward in the middle of each flat side, so don’t overheat it.

    Cut the corners back so there’s about one focal length from the cap to the cut, then heat the side flaps (the shape is rectangular: get this right!) and bend them back. I flattened them against the bench to remove the curve. The top and bottom flaps will fit over the top and bottom of the camera and hold the whole affair in place.

    Trim the side flaps to a few mm, as they’ll just form a light shield, and shape them to clear the controls as needed. Form the top & bottom flaps to fit snugly around the camera and trim to fit; they cover up the buttons just under the camera’s LCD, but those aren’t used in normal operation.

    I used plain old electrical tape to hold the bottle in place, as anything thicker will interfere with the lens rotation. If you have a box-shaped camera, hook-and-loop may be your friend.

    That was enough for one day. Tomorrow: a bit of CNC work on the lid

  • Wooly Bear Caterpillar

    This gizmo appeared in one of Mary’s garden containers and, as is their custom, curled up tight and stayed that way when she picked it up.

    Wooly Bears generally have a central brown band, but all-black isn’t unusual. I hadn’t known about the orange bands across the back between the body segments.

    Those spiny hairs are so stiff and it weighs so little that it skitters around on the desk at the slightest touch, all without moving a muscle…

    Find out more about Wooly Bears there or by searching on the obvious keywords.

    We put it back in the garden where it can turn into a moth and produce more Wooly Bears to delight children of all ages.

    Photography note: exposing a dead-black spiny thing against a woodgrain desktop is basically impossible. The desktop is grossly overexposed so the Wooly Bear details come out more-or-less visible. Ugly, but you get the idea.

  • Pileated Woodpecker

    This fellow has been helping to remove the stump in the front yard for a quite a while; today he let me peek around the edge of the door and take a few pictures…

    He’s about crow-sized with a much snappier paint job.

    Scary-sharp beak!

    Taken with a Sony DSC-H5 with their VCL-HGD1758 1.7x teleconverter lens at about 50 feet, then ruthlessly cropped. Not as good as an SLR with a real telephoto lens, but good enough for my simple needs. The teleconverter with a macro lens on the back provides some standoff distance for photos of tabletop widgetry.

  • Infra-red Photography: Roosting Turkeys

    The turkeys were discussing their activities yesterday evening while getting ready for bed in the trees out back. This isn’t unusual, but they seemed rather louder than usual.

    We walked out the driveway, me with the Sony DSC-F717 in IR Night Shot mode, and eavesdropped for a while. The two early birds in the trees may have been air bosses for the rest of the flock, as nobody else arrived while we were there.

    So I didn’t get any pictures, but it reminded me of some I took a few years ago when a hen with a gaggle of chicks roosted in a maple directly in front of the house.

    Three peeps are easy to see, but she had at least two others snuggled up on her left side!

  • Bullet Hole in Plate Glass

    Pellet gun hole in plate glass
    Pellet gun hole in plate glass

    Found this hole in the plate glass window of a church.

    The conchoidal fracture pattern is characteristic of a bullet impact at more-or-less right angles to the pane. I suppose, based on the very small entry hole and no damage to the opposite wall, that it was something like a BB gun at close range, rather than a 0.22-cal handgun or rifle far away.

    Somehow, you just know the lunkheads doing this sort of thing have never repaired a window themselves… when you’re a constructor, you just don’t go around destroying things.

    But maybe that attitude marks me as a fuddy-duddy.

  • Recovering JPG Images From Damaged Flash Memory

    My DSC-F717 just crashed as I took a picture in the Basement Laboratory; it stalled while writing a picture to the memory stick. This camera is known to have problems with its ribbon cables and I’ve fixed it a few times before, but right now I have other things to do. Who knows? Maybe it’s a different problem altogether.

    Thus, the pertinent question is how to grab the image files from the Memory Stick, even with a damaged filesystem. This trick will work with any memory device, so it’s not just a Memory Stick thing.

    The camera crashed with the Memory Stick activity LED stuck on. Turning the camera off didn’t work: it jammed in the power-down sequence. So I poked the Reset button, which snapped the camera back to 1 January 2002, just after midnight. Alas, it now couldn’t read the Memory Stick, which meant either the filesystem is pooched or the camera’s card socket has gone bad again.

    Mmm, do you know where your camera’s Reset button is? It might not even have one, in which case you just yank the battery. If you can yank the battery, that is.

    Anyhow…

    With the camera turned off: extract the memory card, poke it into a suitable USB card reader, and poke that into your PC (running Linux, of course).

    If the filesystem isn’t too badly damaged, you’ll probably get a popup asking what to do with the new drive (the memory card). Dismiss that, as you don’t want anything writing to the memory without your explicit permission, which you won’t give.

    Figure out which device corresponds to the card and which partition to use:

    dmesg | tail
    [29846.600524] sd 5:0:0:2: [sdd] 1947648 512-byte hardware sectors (997 MB)
    [29846.606022] sd 5:0:0:2: [sdd] Write Protect is off
    [29846.606030] sd 5:0:0:2: [sdd] Mode Sense: 23 00 00 00
    [29846.606033] sd 5:0:0:2: [sdd] Assuming drive cache: write through
    [29846.608748]  sdd: sdd1
    

    In this case, the Memory Stick was intact enough to have a valid partition table, so it could be successfully mounted. However, you don’t want any attempt to write the data, just to keep a bad situation from getting worse. You do that by mounting the device read-only:

    sudo mount -o ro /dev/sdd1 /mnt/part

    You’ll need a suitable mount point; I created /mnt/part early on to hold manually mounted disk partitions.

    The FAT filesystem seemed to point to valid files, but attempting to display them didn’t work. So unmount the device before proceding:

    sudo umount /dev/sdd1

    Switch to /tmp or anywhere you have enough elbow room for a few files the size of the memory card.

    Run dd to make a bit-for-bit copy of the entire drive:

    sudo dd if=/dev/sdd of=memstick.bin bs=1M

    The bs=1M should dramatically speed up the transfer; the default is, IIRC, 512 bytes.

    After this, everything you do uses memstick.bin, not the memory card itself. If you’re paranoid like me, you’ll make a copy of the file before you do anything hazardous. You could even make two copies directly from the memory card and compare them, which might be instructive.

    To find your precious JPG images among the rubble, look for their magic Exif headers:

    strings -t x memstick.bin | grep Exif
      68006 Exif
     258006 Exif
     680006 Exif
     848006 Exif
     a18006 Exif
     bf0006 Exif
     e00006 Exif
     fe8006 Exif
    11e8006 Exif
    1420006 Exif
    ... snippage ...
    

    Because the strings search ignores the (presumably broken) FAT directory structure, you’ll find all the image files on the drive, whether or not they’ve been deleted, partially overwritten, or whatever. This is great for forensics and terrible if you’ve got something to hide. You have been warned.

    The -t x parameter returns the string’s starting offset in hex, which you need to find the actual starting offset of the file: it’s 6 bytes lower! Your mileage may vary, so be prepared to fiddle around a bit.

    You could write a bunch of code to parse the JPG header and extract exactly the number of bytes required, but this is no time for subtle gestures. I just yank out whatever the largest possible image file could be, because image-processing programs only process the valid stuff anyway. So, knowing that this camera produces images in the 2.4 MB range, this extracts the first image:

    dd if=memstick.bin of=image.jpg bs=$((16#1000)) count=1K skip=$((16#68))
    

    The $(( … )) notation evaluates the numeric expression within and the 16#… notation expresses a hexadecimal value.

    Soooo, bs=$((16#1000)) says that the blocksize is 4096 bytes, which you can deduce from the fact that all the Exif headers start 6 bytes from a multiple of 0x1000. Again, your camera may do things differently, but the general notion should get you started.

    If you’re fussy, you’ll note that the headers are actually on multiples of 0x8000 bytes, but using 0x1000 means you can read the high-order digits right off the strings dump. Why make things more complicated than necessary?

    Given a 4K blocksize, count=1K extracts a 4MB chunk: 1024 blocks of 4096 bytes each. That’s larger than the largest possible image file from this camera; adjust it to suit whatever you expect to find. Don’t be stingy, OK?

    The skip=$((16#68)) says to begin extracting data 0x68 blocks into memstick.bin. You read that value directly from the strings output, which is easy enough.

    You could write a tidy Bash script to eat the strings values and spit out the corresponding file chunks. I had few enough images this time to just do it manually, which beats having to debug some code…

    Good luck!

  • Quick-and-easy IR-passing / Visible-blocking Optical Filter

    Gel filters - normal visible light
    Gel filters – normal visible light

    When you don’t need high optical quality for an IR filter, you can superimpose red and blue stage-lighting filters: pure black to the eye, transparent to IR.

    You know they’re IR-transparent because they’re generally snuggled right up against huge incandescent bulbs: if the filter material absorbed any IR, it’d burn right up.

    I’ve used Lee Filters Congo Blue (181) and Primary Red (106) to good effect. They may be available from a stagecraft outlet near you, but around here that stuff is a mailorder deal. You’ll get a lifetime supply, so maybe you can pass some out to your cronies; techies always enjoy odd presents like that.

    A more optically flat (and durable and expensive) option would be a photographic-image-quality glass IR filter suitable for camera mounting. I got one after I dropped a homebrew plastic filter down a sewer grate.

    For examples, go to Adorama, click on Filters in the left column, then select Infra-Red Filters, then maybe refine the search to the cheaper Hoya brand before your budget runs away in fear.

    Gel filters - IR view with visible light
    Gel filters – IR view with visible light

    Make sure your camera doesn’t have an IR blocking filter behind the lens. I think most consumer-grade digital cameras do have an IR-blocking filter and most video cameras don’t, but I’m sure those general rules don’t hold in all cases. Indeed, I bought a Sony DSC-F717 specifically for its IR mode; fortunately, the CCD sensor failed shortly before the factory recall ended.

    The pictures show the same scene under normal lighting, with the camera set to its IR mode, and IR mode with an IR filter in front of the lens.

    The gel filters appear dark-gray in the middle image because the camera sets the exposure (1/60 f2.4 ISO100) based on the visible light entering the lens. They’re transparent in the bottom image because the exposure (1/30 f2.4 ISO1000) is based on only the IR illumination, which is pretty dim. The gratuitous greenish cast is how Sony reminds you that the image was in IR mode

    Gel filters - Pure IR view
    Gel filters – Pure IR view